Skip to content

Commit

Permalink
fix(build): docker image build improvements (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrappachc authored Mar 17, 2021
1 parent 71734ec commit 490ba60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ FROM node:12 AS build
WORKDIR /tf2pickup.pl

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build


FROM node:12 AS production
FROM node:12
WORKDIR /tf2pickup.pl

ARG NODE_ENV=production
Expand All @@ -20,9 +18,10 @@ COPY package*.json ./

RUN npm install --only=production

COPY configs ./configs
COPY --from=build /tf2pickup.pl/configs ./configs
COPY --from=build /tf2pickup.pl/dist ./dist

CMD ["npm", "run", "prod"]
USER node
CMD [ "npm", "run", "prod" ]

EXPOSE 3000
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"declaration": false,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2017",
"lib": ["esnext"],
"sourceMap": true,
"sourceMap": false,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
Expand Down

0 comments on commit 490ba60

Please sign in to comment.