Skip to content

Commit

Permalink
#34: Remove unnecessary stuff in backend docker
Browse files Browse the repository at this point in the history
  • Loading branch information
karifrederiksen committed Aug 11, 2022
1 parent efe0013 commit 85783b8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Build the app
FROM node:16-alpine AS builder
WORKDIR /app
COPY ./package.json ./
Expand All @@ -7,10 +8,20 @@ COPY . .
COPY .env.build .env
RUN npm run build

# Install production node_modules
FROM node:16-alpine as modules-installer
WORKDIR /app
COPY ./package.json ./
COPY ./package-lock.json ./
RUN npm install --omit=dev

# Put things together
FROM node:16-alpine
ARG RAIDSIMP_VERSION
ENV RAIDSIMP_VERSION ${RAIDSIMP_VERSION}
WORKDIR /app
COPY --from=builder /app ./
COPY --from=modules-installer /app/node_modules ./node_modules
COPY --from=builder /app/dist ./
COPY .env.build .env
EXPOSE 3000
CMD ["npm", "run", "start:prod"]
CMD ["NODE_ENV=production", "node", "src/main.js"]

0 comments on commit 85783b8

Please sign in to comment.