From fe848488f0201afa58b5b41f500cee18868e94cb Mon Sep 17 00:00:00 2001 From: nero120 Date: Tue, 1 Jan 2019 14:51:45 +0000 Subject: [PATCH] Added dockerfile and updated target api version to 1.1.7. --- dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 dockerfile diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..cefe825 --- /dev/null +++ b/dockerfile @@ -0,0 +1,20 @@ +FROM node:10.14.2-alpine + +# Set environment variables +ENV XBROWSERSYNC_API_VERSION 1.1.7 + +WORKDIR /usr/src/api + +# Download release and unpack +RUN wget -q -O release.tar.gz https://github.com/xBrowserSync/api/archive/v$XBROWSERSYNC_API_VERSION.tar.gz \ + && tar -C . -xzf release.tar.gz \ + && rm release.tar.gz \ + && mv api-$XBROWSERSYNC_API_VERSION/* . \ + && rm -rf api-$XBROWSERSYNC_API_VERSION/ + +# Install dependencies +RUN npm install --only=production + +# Expose port and start api +EXPOSE 8080 +CMD [ "node", "dist/api.js"] \ No newline at end of file