Skip to content

Commit

Permalink
Sort out docker file so it actually does something
Browse files Browse the repository at this point in the history
  • Loading branch information
gareththegeek committed Jun 6, 2020
1 parent 7cdf622 commit 7ce8e17
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/corewar-hills-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
npm-debug.log
.env
.env
dist
18 changes: 15 additions & 3 deletions packages/corewar-hills-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
FROM node:12 AS builder

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build

FROM node:12

ENV DB_CONNECTION_STRING=

WORKDIR /usr/src/app

COPY package*.json ./
COPY --from=builder /usr/src/app/package*.json /usr/src/app/

RUN npm ci --only=production

COPY . .
COPY --from=builder /usr/src/app/dist /usr/src/app

EXPOSE 4000

CMD ["node", "dist/index.js"]
CMD ["node", "index.js"]

0 comments on commit 7ce8e17

Please sign in to comment.