Skip to content

Commit e6214a0

Browse files
committed
chore: adjust Dockerfiles
1 parent 2772c28 commit e6214a0

File tree

7 files changed

+6
-14
lines changed

7 files changed

+6
-14
lines changed

.github/workflows/cd-registries.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ jobs:
5353
uses: nrwl/nx-set-shas@v3
5454

5555
- name: 'Build images'
56-
run: INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=container --parallel=2
56+
run: INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} pnpm nx affected --base=$NX_BASE --head=$NX_HEAD --target=container --parallel=2
5757

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,3 @@ All parts of the project live inside this monorepo.
3030
- [`mockup`](./apps/mockup/)
3131
- Libs
3232
- [`ui`](./libs/ui/): Common UI components are represented inside this package.
33-
34-
Projects need be configured to output into the workspace `dist` folder.

apps/backend/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM docker.io/node:lts-alpine AS deps
33
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
44
RUN apk add --no-cache libc6-compat
55
WORKDIR /usr/src/app
6-
COPY dist/apps/backend/package*.json ./
6+
COPY package*.json ./
77
RUN npm install --omit=dev
88

99
# Production image, copy all the files and run nest
@@ -14,7 +14,7 @@ ENV PORT=3000
1414
WORKDIR /usr/src/app
1515
COPY --from=deps /usr/src/app/node_modules ./node_modules
1616
COPY --from=deps /usr/src/app/package.json ./package.json
17-
COPY dist/apps/backend .
17+
COPY dist/* .
1818
RUN chown -R node:node .
1919
USER node
2020
EXPOSE 3000

apps/backend/tsconfig.build.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"extends": "./tsconfig.json",
3-
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"],
4-
"compilerOptions": {
5-
"outDir": "../../dist/apps/backend"
6-
}
3+
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
74
}

apps/frontend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM docker.io/nginx:stable-alpine
2-
COPY dist/apps/frontend/* /usr/share/nginx/html/
2+
COPY dist/* /usr/share/nginx/html/
33
EXPOSE 80
44
CMD ["nginx", "-g", "daemon off;"]

apps/frontend/vite.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ export default defineConfig({
66
server: {
77
port: 3001
88
},
9-
build: {
10-
outDir: "../../dist/apps/frontend",
11-
},
129
clearScreen: false,
1310
plugins: [react()],
1411
})

nx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build": {
1010
"dependsOn": ["^build"],
1111
"cache": true,
12-
"outputs": ["{workspaceRoot}/dist/{projectName}"]
12+
"outputs": ["{projectRoot}/dist"]
1313
},
1414
"dev": {
1515
"dependsOn": ["^build"]

0 commit comments

Comments
 (0)