-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# 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 | ||
|
||
|
||
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 | ||
|
||
# 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 | ||
|
||
RUN pnpm run api:deps | ||
|
||
|
||
RUN pnpm api:build | ||
|
||
|
||
EXPOSE 4000 | ||
|
||
|
||
CMD ["pnpm", "api:prod"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: '3.8' | ||
|
||
services: | ||
api: | ||
build: | ||
context: . | ||
dockerfile: api/Dockerfile | ||
ports: | ||
- "4000:4000" | ||
environment: | ||
- NODE_ENV=production | ||
networks: | ||
- 4-growth-docker-network | ||
|
||
client: | ||
build: | ||
context: . | ||
dockerfile: client/Dockerfile | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- NODE_ENV=production | ||
networks: | ||
- 4-growth-docker-network | ||
|
||
|
||
networks: | ||
4-growth-docker-network: | ||
driver: bridge |