diff --git a/docker-compose.yml b/docker-compose.yml index 32ce5f8..96a6278 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,9 +28,11 @@ services: build: context: ./frontend ports: - - "5173:5173" + - "5173" networks: - app_network + depends_on: + - web_server networks: app_network: diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 6dd0237..3bde102 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -17,4 +17,4 @@ COPY . . EXPOSE 5173 # Define the command to run your app -CMD ["npm", "run", "dev"] \ No newline at end of file +CMD ["npm", "run", "dev", "--", "--host"] \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 51f48a6..6aa68b7 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -42,5 +42,9 @@ http { rewrite ^/api/(.*)$ /$1 break; proxy_pass http://web_server:5000; # flask-app is the name of the Flask container in docker-compose } + + location / { + proxy_pass http://frontend:5173; # frontend is the name of the React container in docker-compose + } } }