diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 4953b1f..664e475 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -14,7 +14,7 @@ RUN npm run build-only FROM nginx:alpine COPY --from=builder /app/dist /usr/share/nginx/html - +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..4d532e0 --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,18 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + + try_files $uri $uri/ /index.html; # Redirect all non-static routes to index.html + } + + error_page 404 /index.html; + + location = /index.html { + root /usr/share/nginx/html; + } +} +