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>
This commit is contained in:
2026-06-27 15:07:36 +02:00
parent c482b1787b
commit 02d7f09824
3 changed files with 91 additions and 49 deletions
+15 -8
View File
@@ -3,11 +3,13 @@
# ============================================================
# 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. This approach matches
# other working apps on our servers (e.g. wdj-hermes-frontend-matrix).
# build context with a Dockerfile does not work.
#
# Port hosta: FRONTEND_PORT z .env (domyślnie 8080) → nginx w kontenerze na porcie 80.
# 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:
@@ -16,21 +18,26 @@ services:
container_name: slavic-pulse-com-frontend
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-8080}:80"
- "${FRONTEND_PORT:-8082}:80"
env_file:
- .env
command: >
sh -c "
sh -ce "
echo '[slavic-pulse] Installing git + gettext...' &&
apk add --no-cache git gettext &&
echo '[slavic-pulse] Cloning repo...' &&
rm -rf /app &&
git clone https://gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/site-slavic-pulse-com.git /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 /etc/nginx/conf.d/default.conf &&
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;'
"
@@ -39,7 +46,7 @@ services:
interval: 30s
timeout: 10s
retries: 3
start_period: 45s
start_period: 60s
deploy:
resources: