Skip to content

Commit

Permalink
Merge pull request #27 from kaushiksamanta/feature/optimize-docker-build
Browse files Browse the repository at this point in the history
feat: optimize docker api builds
  • Loading branch information
kaushiksamanta authored Mar 29, 2020
2 parents 15e3bce + 2e86da3 commit 3043f8d
Show file tree
Hide file tree
Showing 5 changed files with 806 additions and 344 deletions.
4 changes: 3 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@
"outputPath": "dist/apps/api",
"main": "apps/api/src/main.ts",
"tsConfig": "apps/api/tsconfig.app.json",
"assets": ["apps/api/src/assets"]
"assets": ["apps/api/src/assets"],
"aot": true,
"webpackConfig": "webpack.config.js"
},
"configurations": {
"production": {
Expand Down
11 changes: 10 additions & 1 deletion api-prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ RUN cd /app && npm run build:api


FROM node:alpine

WORKDIR /app

RUN mkdir node_modules

COPY --from=build-stage /app/dist/apps/api .
COPY --from=build-stage /app/node_modules ./node_modules

RUN npm ci --only=production

RUN npm install -g nodemon

RUN ls -la

EXPOSE 3333

CMD [ "nodemon", "main.js" ]
Loading

0 comments on commit 3043f8d

Please sign in to comment.