Add Dockerfile

This commit is contained in:
Jerko Steiner 2019-11-18 13:52:55 -03:00
parent 23fabb0b0c
commit c373b23f9b
2 changed files with 26 additions and 0 deletions

7
.dockerignore Normal file
View File

@ -0,0 +1,7 @@
.git/
build/
config/local.yaml
coverage/
lib/
node_modules/
Dockerfile

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM node:12-alpine
WORKDIR /app
RUN chown node:node /app
USER node
COPY . .
RUN npm install
RUN npm run build
RUN rm -rf node_modules
FROM node:12-alpine
WORKDIR /app
RUN chown node:node /app
COPY --from=0 /app .
RUN npm install --production
USER root
RUN chown -R root:root .
USER node
EXPOSE 3000
CMD ["node", "lib/index.js"]