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 c1ccbf8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 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
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ services:
- server
environment:
BACKEND_HOST: server
BASE_URL:
BASE_URL: localhost
volumes:
- "${MOUNT_DATA}:/data:ro"
ports:
- "${PORT}:80"
- "${PORT}:${PORT:-80}"

sql:
image: postgres:11-alpine
Expand Down

0 comments on commit c1ccbf8

Please sign in to comment.