diff --git a/api/Dockerfile b/api/Dockerfile index be1f5b1b..36462351 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,5 +1,3 @@ -# TODO: Consider using 2 steps, one for building, then copy the build artifacts to a new image for running. Talk with FE team about this. - FROM node:22.2.0-alpine @@ -10,12 +8,8 @@ COPY package.json pnpm-workspace.yaml pnpm-lock.yaml tsconfig.json ./ COPY api/package.json api/tsconfig.json ./api/ COPY shared/package.json shared/tsconfig.json ./shared/ -# Install jq to extract the version of pnpm from the package.json -RUN apk add --no-cache jq +RUN corepack enable pnpm -# Extract the version of pnpm from the package.json and install it -RUN export PNPM_VERSION=$(jq -r '.packageManager' /app/package.json | cut -d '@' -f 2) && \ - npm install -g pnpm@$PNPM_VERSION COPY api ./api COPY shared ./shared diff --git a/api/src/main.ts b/api/src/main.ts index 13cad38c..8e348dc4 100644 --- a/api/src/main.ts +++ b/api/src/main.ts @@ -3,6 +3,6 @@ import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); - await app.listen(3000); + await app.listen(4000); } bootstrap(); diff --git a/client/Dockerfile b/client/Dockerfile index c6575d92..d73f8105 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,5 +1,3 @@ -# TODO: Consider using 2 steps, one for building, then copy the build artifacts to a new image for running. Talk with FE team about this. - FROM node:22.2.0-alpine WORKDIR /app @@ -9,13 +7,7 @@ COPY package.json pnpm-workspace.yaml pnpm-lock.yaml tsconfig.json ./ COPY client/package.json client/tsconfig.json ./client/ COPY shared/package.json shared/tsconfig.json ./shared/ -# Install jq to extract the version of pnpm from the package.json -RUN apk add --no-cache jq - -# Extract the version of pnpm from the package.json and install it -RUN export PNPM_VERSION=$(jq -r '.packageManager' /app/package.json | cut -d '@' -f 2) && \ - npm install -g pnpm@$PNPM_VERSION - +RUN corepack enable pnpm COPY client ./client COPY shared ./shared diff --git a/docker-compose.yml b/docker-compose.yml index a8cf2035..1c2d8944 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,8 +7,6 @@ services: dockerfile: api/Dockerfile ports: - "4000:4000" - environment: - - NODE_ENV=production networks: - 4-growth-docker-network @@ -18,8 +16,6 @@ services: dockerfile: client/Dockerfile ports: - "3000:3000" - environment: - - NODE_ENV=production networks: - 4-growth-docker-network