Skip to content

Commit

Permalink
docker build improvements and naming consistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlstrm committed Jan 20, 2024
1 parent 6ac3dcf commit c6736e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ WORKDIR /app
COPY packages/ ./packages/
COPY turbo.json ./
COPY package.json turbo.json packages ./
COPY apps/${PROJECT} ./apps/${PROJECT}
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
# Install dependencies as per the lockfile to ensure consistent dependency resolution.
RUN pnpm install --frozen-lockfile

# Prune projects to focus on the specified project scope
# Start a new stage to prune the monorepo, focusing only on the necessary parts for the specified project.
FROM dependencies AS pruner
COPY apps/${PROJECT} ./apps/${PROJECT}
RUN turbo prune --scope=${PROJECT} --docker
# Remove all empty node_modules folders. This is a cleanup step to remove unnecessary directories and reduce image size.
RUN rm -rf /app/out/full/*/*/node_modules
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"db:start": "docker compose up -d",
"db:stop": "docker compose down",
"dev": "pnpm db:start && dotenv -- turbo run dev",
"docker:build:cms": "docker build . --tag cms --build-arg PROJECT=cms",
"docker:build:web": "docker build . --tag web --build-arg PROJECT=web",
"docker:build:cms": "docker build . --tag web-cms --build-arg PROJECT=cms",
"docker:build:web": "docker build . --tag web-web --build-arg PROJECT=web",
"docker:compose:build": "docker compose -f docker-compose.prod.yml up --build",
"docker:compose:start": "docker compose -f docker-compose.prod.yml up",
"docker:start:cms": "docker run -p 3001:3001 cms",
Expand Down

0 comments on commit c6736e6

Please sign in to comment.