Run container as host deploy user
This commit is contained in:
parent
991ccdbbb1
commit
3b2e7cdd12
4 changed files with 12 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
DISCORD_BOT_TOKEN=replace-with-your-discord-bot-token
|
||||
DISCORD_CHANNEL_ID=1504278732070981683
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
ARCHIVE_STATUS_CONFIG=services.json
|
||||
ARCHIVE_STATUS_STATE=state/status-message.json
|
||||
CHECK_INTERVAL_SECONDS=60
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
DISCORD_BOT_TOKEN=replace-with-your-discord-bot-token
|
||||
DISCORD_CHANNEL_ID=1504278732070981683
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
ARCHIVE_STATUS_CONFIG=services.json
|
||||
ARCHIVE_STATUS_STATE=state/status-message.json
|
||||
CHECK_INTERVAL_SECONDS=60
|
||||
|
|
|
|||
|
|
@ -106,12 +106,19 @@ Paste the generated password hash into `.env` before starting the container.
|
|||
Make sure Docker can read the service config and write runtime state:
|
||||
|
||||
```sh
|
||||
printf 'PUID=%s\nPGID=%s\n' "$(id -u)" "$(id -g)" >> .env
|
||||
chmod 600 .env
|
||||
chmod 644 services.json
|
||||
mkdir -p state
|
||||
chmod 755 state
|
||||
```
|
||||
|
||||
If `state/` or `services.json` were created by a previous container as another user, fix ownership once:
|
||||
|
||||
```sh
|
||||
sudo chown -R "$(id -u):$(id -g)" services.json state
|
||||
```
|
||||
|
||||
The bot stores the Discord message ID in `state/status-message.json`. Keep that file mounted so the bot edits the same message after restarts.
|
||||
|
||||
The deploy compose joins your existing reverse-proxy network:
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ services:
|
|||
build: .
|
||||
container_name: archive-status-bot
|
||||
restart: unless-stopped
|
||||
user: "${PUID:-1000}:${PGID:-1000}"
|
||||
env_file:
|
||||
- .env
|
||||
expose:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue