Added dockerfile and updated target api version to 1.1.7.

This commit is contained in:
nero120 2019-01-01 14:51:45 +00:00
parent b2d981b0c7
commit fe848488f0

20
dockerfile Normal file
View file

@ -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"]