Skip to content

Commit

Permalink
🔧 Changed ports configuration
Browse files Browse the repository at this point in the history
- The frontend docker will listen on `PORT` or 80 even inside the
  docker. It allows to run the client standalone.
- The frontend docker can now can take a `BACKEND_PORT` environment
  variable
  • Loading branch information
Lugrim committed May 5, 2024
1 parent d0a8ab3 commit 1e30a6a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions client/docker-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# Integrate environment variables
sed -i "s|__BACKEND__|${BACKEND_HOST}|" \
/etc/nginx/nginx.conf
sed -i "s|__LISTEN_PORT__|${PORT:-80}|" \
/etc/nginx/nginx.conf
sed -i "s|__BACKEND_PORT__|${BACKEND_PORT:-6666}|" \
/etc/nginx/nginx.conf
sed -i "s|__BASEURL__|${BASE_URL:-/}|g" \
/var/www/index.htm \
/var/www/manifest.json
Expand Down
4 changes: 2 additions & 2 deletions client/nginx.conf.docker
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ http {
keepalive_timeout 65;

upstream backend {
server __BACKEND__:6666;
server __BACKEND__:__BACKEND_PORT__;
}

server {
listen 80 default_server;
listen __LISTEN_PORT__ default_server;

location ~ ^/api$ {
return 302 /api/;
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:
volumes:
- "${MOUNT_DATA}:/data:ro"
ports:
- "${PORT}:80"
- "${PORT}:${PORT:-80}"

sql:
image: postgres:11-alpine
Expand Down

0 comments on commit 1e30a6a

Please sign in to comment.