Skip to content

Commit

Permalink
minor changes to Docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
agnlez committed May 20, 2024
1 parent 82dc232 commit e4026c3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 21 deletions.
8 changes: 1 addition & 7 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
10 changes: 1 addition & 9 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ services:
dockerfile: api/Dockerfile
ports:
- "4000:4000"
environment:
- NODE_ENV=production
networks:
- 4-growth-docker-network

Expand All @@ -18,8 +16,6 @@ services:
dockerfile: client/Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=production
networks:
- 4-growth-docker-network

Expand Down

0 comments on commit e4026c3

Please sign in to comment.