diff --git a/Dockerfile.web b/Dockerfile.web index 1f5485f..782119f 100644 --- a/Dockerfile.web +++ b/Dockerfile.web @@ -9,6 +9,6 @@ RUN pnpm run build FROM nginx:stable-alpine COPY --from=build /app/apps/web/dist /usr/share/nginx/html -COPY apps/web/nginx.conf /etc/nginx/conf.d/default.conf +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..773b8d3 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,19 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location /api/ { + proxy_pass http://fitness-api:5000; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection keep-alive; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } +}