Repository navigation
Conversation
…rt Passenger on API_PORT Two small problems with the docker-compose setup used for LAN self-hosting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small problems with the docker-compose setup used for LAN self-hosting.
1. Most of the stack does not come back after a reboot or power cut. Only
db,delayed_jobandlog_digestshaverestart: always.redis,web,mqtt,assetsandrabbit_jobshave no policy, so Docker's default (no) applies and they stay down after the host reboots, until someone runsdocker compose upagain.delayed_jobandlog_digestsdo come back, but they can't reachmqtt, so the auto-sync broadcasts made in that time fail and are dropped. RabbitMQ authenticates every login (including the bot's) over HTTP againstweb, and that path uses redis (BrokerConnectionLimiter), so all three need to be up before a bot can connect. For an unattended self-hosted farm this means the bot stays disconnected after every power cut until someone gets to a terminal. The same happens if one of these containers crashes while the stack is running.2. Any
API_PORTother than 3000 leaves the server unreachable. Thewebservice publishes"${API_PORT}:${API_PORT}", but starts Passenger without--port, so inside the container it always listens on 3000 (Passenger Standalone's default; there is no Passengerfile.json). WithAPI_PORT=80(which example.env's comment suggests is an option), host port 80 maps to container port 80 where nothing listens. Everything else is built fromAPI_PORT(tokeniss,$API_URL, the RabbitMQauth_httpURLs), so the web UI,/api/tokensand MQTT logins all fail. The HerokuProcfilealready passes-p $PORT.Changes:
docker-compose.yml:restart: unless-stoppedtoredis,web,mqtt,assetsandrabbit_jobs(unless-stoppedrather thanalways, sodocker compose stopstill keeps them stopped across a reboot). Thetypescriptwatcher is a development tool and is left as it is.--port ${API_PORT:-3000}, so the container listens on the port that is published. With the shippedAPI_PORT=3000nothing changes.example.env: note underAPI_PORTthat compose does not terminate SSL, so 443 needs a separate TLS proxy.Testing: I parsed the changed
docker-compose.ymlwith Python's YAML loader and checked the restart policies and thewebcommand. I don't have Docker on the machine I used, so I couldn't rundocker compose upor a reboot test. One thing worth checking: I haven't verified howdocker compose run web ...(used in the setup/upgrade instructions) treats the new restart policy for one-off containers.🤖 Generated with Claude Code