Skip to content

Commit

Permalink
fixed the webclient not emmerging because in prod the services are na…
Browse files Browse the repository at this point in the history
…med differently
  • Loading branch information
CommanderStorm committed Nov 11, 2023
1 parent d597eeb commit 307ebd0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
11 changes: 11 additions & 0 deletions deployment/k3s/templates/deployments/webclient-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ spec:
ports:
- containerPort: 3000
name: webclient
env:
- name: TILESERVER_URL
value: http://maps-svc.svc.cluster.local:3001
- name: CDN_URL
value: http://cdn-svc.svc.cluster.local:3002
- name: MAIN_API_URL
value: http://api-svc.svc.cluster.local:3003
- name: FEEDBACK_API_URL
value: http://feedback-svc.svc.cluster.local:3004
- name: CALENDAR_API_URL
value: http://calendar-svc.svc.cluster.local:3005
resources:
requests:
cpu: 5m
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ services:
build: ./webclient
ports:
- "3000:3000"
environment:
TILESERVER_URL: http://tilserver:3001
CDN_URL: http://cdn:3002
MAIN_API_URL: http://main-api:3003
FEEDBACK_API_URL: http://feedback-api:3004
CALENDAR_API_URL: http://calendar-api:3005
# maps
tileserver-init-sprites:
image: alpine:latest
Expand Down
2 changes: 1 addition & 1 deletion webclient/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ COPY --from=build-stage /dist /app

EXPOSE 3000
HEALTHCHECK CMD curl --fail localhost:3000/health || exit 1
CMD ["nginx", "-g", "daemon off;"]
CMD sh -c "sed -i 's|TILESERVER_URL|${TILESERVER_URL}|g' /etc/nginx/nginx.conf && sed -i 's|CDN_URL|${CDN_URL}|g' /etc/nginx/nginx.conf && sed -i 's|MAIN_API_URL|${MAIN_API_URL}|g' /etc/nginx/nginx.conf && sed -i 's|FEEDBACK_API_URL|${FEEDBACK_API_URL}|g' /etc/nginx/nginx.conf && sed -i 's|CALENDAR_API_URL|${CALENDAR_API_URL}|g' /etc/nginx/nginx.conf && cat /etc/nginx/nginx.conf && nginx -g daemon off;"]
10 changes: 5 additions & 5 deletions webclient/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ http {

# for development
location /api/ {
proxy_pass http://main-api:3003;
proxy_pass MAIN_API_URL;
}
location /api/feedback {
proxy_pass http://feedback-api:3004;
proxy_pass FEEDBACK_API_URL;
}
location /api/calendar {
proxy_pass http://calendar-api:3005;
proxy_pass CALENDAR_API_URL;
}
location /cdn {
proxy_pass http://data:3002;
proxy_pass CDN_URL;
}
location /maps/ {
proxy_pass http://tileserver:3001;
proxy_pass TILESERVER_URL;
}

location / {
Expand Down

0 comments on commit 307ebd0

Please sign in to comment.