b8bb8eecd2
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>
62 lines
2.2 KiB
YAML
62 lines
2.2 KiB
YAML
# ============================================================
|
|
# Slavic Pulse - Docker Compose (Dokploy / manual)
|
|
# ============================================================
|
|
# 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).
|
|
#
|
|
# 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:
|
|
image: nginx:1.27-alpine
|
|
container_name: slavic-pulse-com-frontend
|
|
restart: unless-stopped
|
|
|
|
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: 60s
|
|
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
cpus: "0.5"
|
|
reservations:
|
|
memory: 64M
|