Skip to content

Commit 93527a9

Browse files
committed
Prevent copying to docker unnecessary files outside of our packages and package/tsconfig
1 parent 8b32314 commit 93527a9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ RUN --mount=type=bind,source=package.json,target=package.json \
2525

2626

2727
# Copy the rest of the source files into the image.
28-
COPY --link . .
28+
COPY --link package*.json tsconfig*.json .
29+
COPY --link packages packages
2930

30-
RUN npm run build --ws
31+
RUN ls && npm run build --ws
3132

3233
FROM node:${NODE_VERSION}-alpine AS production-base
3334

packages/frontend/nginx/default.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This is a template as described here https://hub.docker.com/_/nginx
2+
# Inspiration source https://levelup.gitconnected.com/packaging-front-end-react-applications-under-a-production-environment-with-vite-and-nginx-in-docker-7e2739bc0494
13
server {
24
listen $PORT;
35
server_name localhost;
@@ -7,6 +9,8 @@ server {
79
try_files $uri $uri/ /index.html;
810
}
911
location /api/ {
12+
proxy_set_header Host $host;
13+
proxy_set_header X-Real-IP $remote_addr;
1014
proxy_pass $BACKEND_URL;
1115
}
1216
}

0 commit comments

Comments
 (0)