docker: NPM joins dmtools_default, not a shared proxy network
NPM (nginx_app_1) is connected to each stack's own default network by hand, not to a shared docker_default. Drop the unused external `proxy` network from the compose file; nginx just lives on dmtools_default. setup.sh now connects NPM to it (no-op if already connected) and prints the proxy-host settings. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -114,6 +114,15 @@ pexec php bin/console asset-map:compile
|
||||
# php-fpm runs as www-data and must be able to write there at runtime.
|
||||
pexec chown -R www-data:www-data var
|
||||
|
||||
# Make sure Nginx Proxy Manager can reach this stack's nginx by name.
|
||||
# Harmless (and a no-op) if already connected; NPM keeps it across restarts.
|
||||
NPM_CONTAINER="${NPM_CONTAINER:-nginx_app_1}"
|
||||
if docker inspect "$NPM_CONTAINER" >/dev/null 2>&1; then
|
||||
docker network connect "${PROJECT}_default" "$NPM_CONTAINER" 2>/dev/null \
|
||||
&& echo "Connected $NPM_CONTAINER to ${PROJECT}_default." \
|
||||
|| true
|
||||
fi
|
||||
|
||||
APP_URL="http://localhost:${NGINX_PORT:-8085}"
|
||||
cat <<EOT
|
||||
|
||||
@@ -121,6 +130,10 @@ Setup complete!
|
||||
|
||||
Open the app: $APP_URL (real access is via https://dmtools.fvandenberg.nl through NPM)
|
||||
|
||||
NPM proxy host: scheme http, forward "dmtools-nginx" port 80.
|
||||
If NPM ($NPM_CONTAINER) can't reach it, run:
|
||||
docker network connect ${PROJECT}_default $NPM_CONTAINER
|
||||
|
||||
Create the first user:
|
||||
$DOCKER_COMPOSE -p $PROJECT exec php php bin/console app:user:create you@example.com --admin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user