Files
site-agencja-ai-com/docker-compose-example/docker-compose.yml
T
tomasz-syn-grzegorza 22c3df41a8 Migrate to env-driven templates and slavic-pulse feature set.
Replace hardcoded HTML with .env generation, YouTube thumbnail backgrounds, responsive FHD/vertical intro, hardened nginx, and updated Dokploy deploy flow.

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

62 lines
2.1 KiB
YAML

# ============================================================
# Agencja AI - 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.
#
# 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: agencja-ai-com-frontend
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-8080}:80"
env_file:
- .env
command: >
sh -ce "
echo '[agencja-ai] Installing git + gettext...' &&
apk add --no-cache git gettext &&
echo '[agencja-ai] Cloning repo...' &&
rm -rf /app &&
git clone --depth 1 https://gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/site-agencja-ai-com.git /app &&
echo '[agencja-ai] 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 '[agencja-ai] 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 '[agencja-ai] Removing cloned repo from container...' &&
rm -rf /app &&
echo '[agencja-ai] 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