Add Dockerfile
This commit is contained in:
parent
23fabb0b0c
commit
c373b23f9b
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@ -0,0 +1,7 @@
|
||||
.git/
|
||||
build/
|
||||
config/local.yaml
|
||||
coverage/
|
||||
lib/
|
||||
node_modules/
|
||||
Dockerfile
|
||||
19
Dockerfile
Normal file
19
Dockerfile
Normal 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"]
|
||||
Loading…
x
Reference in New Issue
Block a user