diff --git a/Dockerfile b/Dockerfile index 88b230714c66fe8743ef3c17ad97a6be0cb53a86..e8c0bf52224ae132bcd25c8f7826f6f33544b364 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,10 @@ RUN npm run ng build --configuration=prod FROM nginx:alpine # Copy the built app from the 'build' stage to the current stage -COPY --from=build /usr/src/app/dist/graphene-ui /usr/share/nginx/html +COPY --from=build /usr/src/app/dist/graphene-ui/browser /usr/share/nginx/html +# Copy the custom Nginx configuration file +COPY nginx.conf /etc/nginx/conf.d/default.conf # Start Nginx CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000000000000000000000000000000000000..a40436b2c965786f91c7277607e0c56a4f24460d --- /dev/null +++ b/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + location / { + # Angular routing fallback + try_files $uri /index.html; + } + + error_page 404 /index.html; +}