Skip to content

Commit

Permalink
[devcontainers] Refactor Nginx configuration for serving static files
Browse files Browse the repository at this point in the history
Simplify the Nginx setup by removing the elements-nginx service and directly serving static files from the main Nginx container. Updated volume mounts and configuration to reflect these changes.
  • Loading branch information
MarianPalkus committed Oct 28, 2024
1 parent 5c6e69a commit a3741ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
10 changes: 2 additions & 8 deletions deploy/docker-compose/devcontainer-nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ server {
server_name hanko-quickstart;

location /elements.js {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://elements-nginx/elements/elements.js;
root /usr/share/nginx/html/elements/;
}

location /sdk.modern.js {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://elements-nginx/frontend-sdk/sdk.modern.js;
root /usr/share/nginx/html/frontend-sdk/;
}

location /backend/ {
Expand Down
16 changes: 2 additions & 14 deletions deploy/docker-compose/devcontainers-full-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,6 @@ services:
target: /workspace
networks:
- intranet
elements-nginx:
image: nginx:1-alpine
depends_on:
elements:
condition: service_started
ports:
- 8089:80
networks:
- intranet
volumes:
- ../../frontend/elements/dist/:/usr/share/nginx/html/elements/
- ../../frontend/frontend-sdk/dist/:/usr/share/nginx/html/frontend-sdk/
quickstart:
build: ../../quickstart
ports:
Expand All @@ -95,11 +83,11 @@ services:
image: nginx
volumes:
- ./devcontainer-nginx.conf:/etc/nginx/conf.d/default.conf
- ../../frontend/elements/dist/:/usr/share/nginx/html/elements/
- ../../frontend/frontend-sdk/dist/:/usr/share/nginx/html/frontend-sdk/
depends_on:
hanko:
condition: service_started
elements-nginx:
condition: service_started
mail:
condition: service_started
quickstart:
Expand Down

0 comments on commit a3741ab

Please sign in to comment.