fix: bug: dispatcher fails in edge container — lib/env.sh not available (#119) #121
3 changed files with 21 additions and 2 deletions
|
|
@ -278,9 +278,11 @@ services:
|
|||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
environment:
|
||||
- DISINTO_VERSION=${DISINTO_VERSION:-main}
|
||||
- FORGE_URL=http://forgejo:3000
|
||||
volumes:
|
||||
- ./docker/Caddyfile:/etc/caddy/Caddyfile
|
||||
- ./docker/edge/dispatcher.sh:/usr/local/bin/dispatcher.sh:ro
|
||||
- caddy_data:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
depends_on:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
FROM caddy:alpine
|
||||
RUN apk add --no-cache bash jq curl git docker-cli
|
||||
COPY dispatcher.sh /usr/local/bin/dispatcher.sh
|
||||
COPY entrypoint-edge.sh /usr/local/bin/entrypoint-edge.sh
|
||||
ENTRYPOINT ["bash", "/usr/local/bin/entrypoint-edge.sh"]
|
||||
|
|
|
|||
16
docker/edge/entrypoint-edge.sh
Executable file
16
docker/edge/entrypoint-edge.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
DISINTO_VERSION="${DISINTO_VERSION:-main}"
|
||||
DISINTO_REPO="${FORGE_URL:-http://forgejo:3000}/johba/disinto.git"
|
||||
|
||||
# Shallow clone at the pinned version
|
||||
if [ ! -d /opt/disinto/.git ]; then
|
||||
git clone --depth 1 --branch "$DISINTO_VERSION" "$DISINTO_REPO" /opt/disinto
|
||||
fi
|
||||
|
||||
# Start dispatcher in background
|
||||
bash /opt/disinto/docker/edge/dispatcher.sh &
|
||||
|
||||
# Caddy as main process
|
||||
exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
|
||||
Loading…
Add table
Add a link
Reference in a new issue