Add Dockerfile

This commit is contained in:
3nprob 2021-10-07 00:24:55 +09:00
parent 7c2e53c6e4
commit 96c28027ef
2 changed files with 22 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
node_modules
samples
dist

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM node:16-slim as builder
COPY . /app
WORKDIR /app
RUN npm ci && npm run build
FROM node:16-slim
COPY --from=builder /app/dist/ /app/
COPY --from=builder /app/package.json /app/
COPY --from=builder /app/package-lock.json /app/
COPY --from=builder /app/static/ /app/static/
COPY --from=builder /app/templates/ /app/templates/
WORKDIR /app
RUN npm install --production
CMD ["/usr/local/bin/node", "index.js"]