Fix Dokploy deploy to match agencja-ai runtime clone pattern.

Revert compose to public git clone with env-based HTML generation, allow inline scripts in CSP for YouTube player, and use window.location.origin for embed origin.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-27 17:25:28 +02:00
parent f4775366ef
commit b8bb8eecd2
6 changed files with 76 additions and 51 deletions
+33 -11
View File
@@ -1,34 +1,56 @@
# ============================================================
# Slavic Pulse - Docker Compose (Dokploy / manual)
# ============================================================
# Dokploy + Traefik: NIE mapuj portu na hosta (ports:).
# W UI Dokploy ustaw domenę i Container Port = 80 — Traefik routuje po FQDN.
# Wewnętrznie nginx nasłuchuje na :80 (expose poniżej).
# Dokploy-compatible pattern: pre-built nginx image + runtime git clone.
# Dokploy only copies docker-compose.yml + .env to the server, so local
# build context with a Dockerfile does not work (same as site-agencja-ai-com).
#
# Build z Dockerfile — Dokploy klonuje repo na hoście i buduje obraz.
# Brak runtime git clone w kontenerze (hardening bezpieczeństwa).
# Repo publiczne — clone bez tokenu. HTML generowany z .env przy starcie.
# Po setupie /app jest usuwane (brak pełnego repo na dysku kontenera).
#
# Port hosta: FRONTEND_PORT z .env → nginx w kontenerze na porcie 80.
# Dokploy/Traefik routuje po FQDN do wewnętrznego portu 80 kontenera.
# ============================================================
services:
frontend:
build:
context: ..
dockerfile: Dockerfile
image: nginx:1.27-alpine
container_name: slavic-pulse-com-frontend
restart: unless-stopped
expose:
- "80"
ports:
- "${FRONTEND_PORT:-8080}: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 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 &&
cp /app/nginx.conf /etc/nginx/nginx.conf &&
echo '[slavic-pulse] Removing cloned repo from container...' &&
rm -rf /app &&
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: 15s
start_period: 60s
deploy:
resources: