Frontend fix

This commit is contained in:
junwei 2023-11-01 07:53:51 +08:00
parent a3cd4f8168
commit 7fc266c7a6
3 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,9 @@
version: '3'
services:
frontend:
image: amusement3004/safeshare-frontend:latest
restart:
always
ports:
- "80:80" # Map container port 3000 to host port 3000

View File

@ -5,6 +5,8 @@ WORKDIR /frontend
COPY . . COPY . .
ENV REACT_APP_API_HOST http://127.0.0.1:8000
RUN npm install RUN npm install
RUN npm run build RUN npm run build

View File

@ -7,7 +7,7 @@ server {
} }
location /api/ { location /api/ {
proxy_pass http://safeshare-backend-service:8000; proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;