Skip to content

Commit af3207a

Browse files
committed
seperate service for nginx
1 parent 961150c commit af3207a

File tree

8 files changed

+58
-222
lines changed

8 files changed

+58
-222
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,25 @@ http {
99
keepalive_timeout 65;
1010

1111
server {
12-
listen 80;
12+
listen 8088;
1313
server_name _;
1414

15-
root /usr/share/nginx/html;
16-
index index.html;
15+
# ssl_certificate /etc/nginx/certs/selfsigned.crt;
16+
# ssl_certificate_key /etc/nginx/certs/selfsigned.key;
1717

18-
# Proxy API requests to backend
18+
# Forward API requests to backend (with WebSocket support)
1919
location /api/v1/ {
2020
proxy_pass http://backend:8080/api/v1/;
2121
proxy_set_header Host $host;
2222
proxy_set_header X-Real-IP $remote_addr;
2323
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2424
proxy_set_header X-Forwarded-Proto $scheme;
25-
26-
# WebSocket support
2725
proxy_http_version 1.1;
28-
proxy_set_header Upgrade $http_upgrade;
29-
proxy_set_header Connection "upgrade";
26+
proxy_set_header Upgrade $http_upgrade;
27+
proxy_set_header Connection "upgrade";
3028
}
3129

32-
# Proxy elevation API to external service
30+
# Forward elevation API to external service
3331
location /elevation-api/ {
3432
proxy_pass https://api.opentopodata.org/;
3533
proxy_set_header Host api.opentopodata.org;
@@ -38,9 +36,13 @@ http {
3836
proxy_set_header X-Forwarded-Proto $scheme;
3937
}
4038

41-
# SPA fallback
39+
# Forward all other requests to the frontend container
4240
location / {
43-
try_files $uri $uri/ /index.html;
41+
proxy_pass http://frontend:80;
42+
proxy_set_header Host $host;
43+
proxy_set_header X-Real-IP $remote_addr;
44+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
45+
proxy_set_header X-Forwarded-Proto $scheme;
4446
}
4547
}
4648
}

prod.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ services:
1717
depends_on:
1818
postgres:
1919
condition: service_healthy
20+
ports:
21+
- "8081:8080"
2022
networks:
2123
- blueprint
2224

2325
frontend:
2426
image: zephiron/rocket-website:latest
25-
restart: unless-stopped
2627
ports:
2728
- "8080:80"
2829
depends_on:
@@ -63,6 +64,19 @@ services:
6364
postgres:
6465
condition: service_healthy
6566

67+
reverse-proxy:
68+
image: nginx:1.27-alpine
69+
volumes:
70+
- ./nginx-reverse.conf:/etc/nginx/nginx.conf:ro
71+
ports:
72+
- "8088:8088"
73+
- "8443:8443"
74+
depends_on:
75+
- frontend
76+
- backend
77+
networks:
78+
- blueprint
79+
6680
volumes:
6781
psql_volume_bp:
6882

rocket-backend/.air.toml

Lines changed: 0 additions & 46 deletions
This file was deleted.

rocket-backend/.goreleaser.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

rocket-backend/prod.yml

Lines changed: 0 additions & 87 deletions
This file was deleted.

website/.dockerignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Ignore dependencies and build output
2+
node_modules
3+
dist
4+
5+
# Ignore IDE/editor/project files
6+
.vscode
7+
.idea
8+
*.swp
9+
*.swo
10+
11+
# Ignore logs and OS files
12+
npm-debug.log*
13+
yarn-debug.log*
14+
yarn-error.log*
15+
.DS_Store
16+
Thumbs.db
17+
18+
# Ignore test and coverage files
19+
coverage
20+
*.test.*
21+
*.spec.*
22+
23+
# Ignore version control and dev configs
24+
.git
25+
.gitignore
26+
README.md
27+
.eslintrc.*
28+
.prettierrc.*
29+
.dockerignore

website/Dockerfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,4 @@ FROM nginx:1.27-alpine AS deploy
1919
# Copy built assets from build stage
2020
COPY --from=build /app/dist /usr/share/nginx/html
2121

22-
# Copy custom nginx config
23-
COPY nginx.conf /etc/nginx/nginx.conf
24-
25-
EXPOSE 80
26-
27-
CMD ["nginx", "-g", "daemon off;"]
22+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)