Skip to content

Commit b41efc1

Browse files
Merge pull request #37 from stefanbobrowski/feature/mvp
docker path fix
2 parents 5401ee4 + d740cd6 commit b41efc1

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/workflows/google-cloudrun-docker.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ jobs:
4747
--image=${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }} \
4848
--region=${{ env.REGION }} \
4949
--platform=managed \
50-
--allow-unauthenticated
50+
--allow-unauthenticated \
51+
--set-env-vars=NODE_ENV=production,GCLOUD_PROJECT=${{ env.PROJECT_ID }},GOOGLE_CLOUD_PROJECT=${{ env.PROJECT_ID }},GCLOUD_LOCATION=${{ env.REGION }},VITE_RECAPTCHA_SITE_KEY=${{ secrets.VITE_RECAPTCHA_SITE_KEY }},MAX_REQUESTS_PER_HOUR=${{ secrets.MAX_REQUESTS_PER_HOUR }}

Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,25 @@ RUN npm install
77
COPY frontend/ ./
88
RUN npm run build
99

10-
# Stage 2: Backend
10+
# Stage 2: Build backend
1111
FROM node:20-alpine
1212
WORKDIR /app
1313

14-
# Copy backend dependencies & install
14+
# Copy backend package files and install deps
1515
COPY backend/package*.json ./backend/
16-
WORKDIR /app/backend
17-
RUN npm install --omit=dev
16+
RUN cd backend && npm install --omit=dev
1817

19-
# Copy backend source
20-
COPY backend/ ./backend/
18+
# Copy backend code
19+
COPY backend ./backend
2120

2221
# Copy built frontend into backend's dist folder
23-
COPY --from=build-frontend /app/frontend/dist ./frontend/dist
22+
COPY --from=build-frontend /app/frontend/dist ./backend/frontend/dist
23+
24+
# Set working directory to backend
25+
WORKDIR /app/backend
2426

2527
EXPOSE 8080
28+
29+
# Explicit path to server.js
2630
CMD ["node", "server.js"]
31+

0 commit comments

Comments
 (0)