Skip to content

Commit 3ad3e85

Browse files
authored
Fix Docker Atlas seeding and frontend codegen build. (#7)
Ensure frontend Docker builds generate GraphQL types from backend schema and include CA certificates in backend runtime so mongorestore can seed Atlas successfully.
1 parent b9ab2c0 commit 3ad3e85

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ENV NODE_ENV=production
3838
# are all that's pulled in to keep the final image lean.
3939
COPY --from=tools /usr/local/bin/mongorestore /usr/local/bin/mongorestore
4040
RUN apt-get update \
41-
&& apt-get install -y --no-install-recommends libgssapi-krb5-2 \
41+
&& apt-get install -y --no-install-recommends ca-certificates libgssapi-krb5-2 \
4242
&& rm -rf /var/lib/apt/lists/*
4343

4444
COPY package.json package-lock.json* ./

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ services:
5656

5757
frontend:
5858
build:
59-
context: ./frontend
60-
dockerfile: Dockerfile
59+
context: .
60+
dockerfile: frontend/Dockerfile
6161
container_name: ev-demo-frontend
6262
env_file:
6363
- .env

frontend/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ FROM node:24-bookworm-slim AS builder
33

44
WORKDIR /app
55

6-
COPY package.json package-lock.json* ./
6+
COPY frontend/package.json frontend/package-lock.json* ./
77
RUN npm install
88

9-
COPY . .
10-
RUN npm run build
9+
COPY frontend/ ./
10+
COPY backend/schema /backend/schema
11+
RUN npm run codegen && npm run build
1112

1213
# Production stage
1314
FROM node:24-bookworm-slim AS runner

0 commit comments

Comments
 (0)