Files
site-slavic-pulse-com/docker-compose-example/docker-compose.yml
T
tomasz-syn-grzegorza 02d7f09824 Fix Dokploy deploy: support private Gitea repo and document exit 128.
Add GITEA_REPO_URL for authenticated clone, improve startup logging, default FRONTEND_PORT to 8082, and update deployment README.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 15:07:36 +02:00

58 lines
2.1 KiB
YAML

# ============================================================
# Slavic Pulse - Docker Compose (Dokploy / manual)
# ============================================================
# Dokploy-compatible pattern: uses pre-built image + runtime git clone.
# Dokploy only copies docker-compose.yml + .env to the server, so local
# build context with a Dockerfile does not work.
#
# Port hosta: FRONTEND_PORT z .env (domyślnie 8082) → nginx w kontenerze na porcie 80.
# Dokploy/Traefik routuje po FQDN do wewnętrznego portu 80 kontenera.
#
# WAŻNE: repozytorium Gitea musi być publiczne LUB ustaw GITEA_REPO_URL z tokenem w .env
# (patrz README — bez tego git clone kończy się exit 128 i kontener restartuje w pętli).
# ============================================================
services:
frontend:
image: nginx:1.27-alpine
container_name: slavic-pulse-com-frontend
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-8082}:80"
env_file:
- .env
command: >
sh -ce "
echo '[slavic-pulse] Installing git + gettext...' &&
apk add --no-cache git gettext &&
echo '[slavic-pulse] Cloning repo...' &&
rm -rf /app &&
git clone --depth 1 \"$${GITEA_REPO_URL:-https://gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/site-slavic-pulse-com.git}\" /app &&
echo '[slavic-pulse] Generating index.html from .env...' &&
chmod +x /app/generate-from-env.sh &&
TEMPLATE_DIR=/app /app/generate-from-env.sh /usr/share/nginx/html &&
echo '[slavic-pulse] Copying assets and nginx config...' &&
cp -r /app/assets /usr/share/nginx/html/assets &&
rm -f /etc/nginx/conf.d/default.conf &&
cp /app/default.conf /etc/nginx/conf.d/default.conf &&
echo '[slavic-pulse] Starting nginx...' &&
nginx -g 'daemon off;'
"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:80/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
deploy:
resources:
limits:
memory: 256M
cpus: "0.5"
reservations:
memory: 64M