Skip to content

Commit

Permalink
ci(monorepo): docker images could not been build #111
Browse files Browse the repository at this point in the history
  • Loading branch information
smolovyk.oleg authored and mathpaquette committed Jun 5, 2024
1 parent 3db3cf1 commit d69eb19
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ COPY ./tools ./tools
COPY package.json .
COPY package-lock.json .
COPY nx.json .
COPY workspace.json .
COPY tsconfig.base.json .

RUN npm install
RUN npx nx affected:build --all --configuration=production --verbose
RUN npx nx run api:build:production --verbose
RUN npm install --omit dev

FROM node:16-alpine
FROM node:18-alpine
WORKDIR /app

COPY --from=build --chown=node:node /build/dist/apps/api ./api
Expand Down
3 changes: 1 addition & 2 deletions apps/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ COPY ./tools ./tools
COPY package.json .
COPY package-lock.json .
COPY nx.json .
COPY workspace.json .
COPY tsconfig.base.json .

RUN npm install
RUN npx nx affected:build --all --configuration=production --verbose
RUN npx nx run frontend:build:production --verbose
RUN npm install --omit dev

FROM nginxinc/nginx-unprivileged:1-alpine
Expand Down
5 changes: 2 additions & 3 deletions libs/db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ COPY ./tools ./tools
COPY package.json .
COPY package-lock.json .
COPY nx.json .
COPY workspace.json .
COPY tsconfig.base.json .

RUN npm install
RUN npx nx affected:build --all --configuration=production --verbose
RUN npx nx run db:build:production --verbose
RUN npm install --omit dev

FROM node:16-alpine
FROM node:18-alpine
WORKDIR /app

COPY --from=build /build/dist/libs/db ./dist/libs/db
Expand Down
1 change: 1 addition & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
"cache": true
},
Expand Down

0 comments on commit d69eb19

Please sign in to comment.