Configure agencja-ai.com deployment and local dev environment.

Separate container name and port 8081 for parallel dev, add docker-compose.dev.yml
with volume mounts, and point Dokploy example to site-agencja-ai-com Gitea repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 14:11:49 +02:00
parent d565f83490
commit 808c39d838
7 changed files with 57 additions and 8 deletions
+1 -1
View File
@@ -5,4 +5,4 @@
# --- Frontend Server --- # --- Frontend Server ---
# Port na hoście (localhost). W kontenerze nginx zawsze nasłuchuje na 80. # Port na hoście (localhost). W kontenerze nginx zawsze nasłuchuje na 80.
# Mapowanie w docker-compose.yml: ${FRONTEND_PORT}:80 # Mapowanie w docker-compose.yml: ${FRONTEND_PORT}:80
FRONTEND_PORT=8080 FRONTEND_PORT=8081
Executable
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Lokalny dev: nginx z volume mount — zmiany w plikach widoczne po F5 w przeglądarce.
set -euo pipefail
cd "$(dirname "$0")"
COMPOSE="docker compose -f docker-compose.yml -f docker-compose.dev.yml"
if [[ ! -f .env ]]; then
cp .env.example .env
echo "Utworzono .env z .env.example"
fi
case "${1:-up}" in
up)
$COMPOSE up -d
echo ""
echo "Dev server: http://localhost:${FRONTEND_PORT:-8081}"
echo "Edytuj pliki → F5 w przeglądarce (bez rebuildu)."
;;
down)
$COMPOSE down
;;
logs)
$COMPOSE logs -f
;;
restart)
$COMPOSE restart
;;
reload-nginx)
docker exec agencja-ai-com-frontend nginx -s reload
echo "Nginx przeładowany (po zmianie default.conf)."
;;
*)
echo "Użycie: $0 [up|down|logs|restart|reload-nginx]"
exit 1
;;
esac
+1 -1
View File
@@ -6,4 +6,4 @@
# Port publikowany na hoście. W kontenerze nginx zawsze nasłuchuje na 80. # Port publikowany na hoście. W kontenerze nginx zawsze nasłuchuje na 80.
# Mapowanie w docker-compose.yml: ${FRONTEND_PORT}:80 # Mapowanie w docker-compose.yml: ${FRONTEND_PORT}:80
# Dokploy/Traefik dodatkowo routuje po FQDN do wewnętrznego portu 80 kontenera. # Dokploy/Traefik dodatkowo routuje po FQDN do wewnętrznego portu 80 kontenera.
FRONTEND_PORT=8080 FRONTEND_PORT=8081
+3 -3
View File
@@ -5,7 +5,7 @@ Strona internetowa ze statycznym obrazem tła od pierwszej klatki i krótkim int
## Struktura projektu ## Struktura projektu
``` ```
site-agency-ai-dev/ site-agencja-ai-com/
├── docker-compose.yml # Lokalny dev (build: context .) ├── docker-compose.yml # Lokalny dev (build: context .)
├── Dockerfile # Kontener nginx 1.27 Alpine ├── Dockerfile # Kontener nginx 1.27 Alpine
├── default.conf # Konfiguracja nginx ├── default.conf # Konfiguracja nginx
@@ -29,9 +29,9 @@ Używa `build:` z Dockerfile — buduje obraz lokalnie. Port hosta ustawiasz w `
```bash ```bash
cp .env.example .env # opcjonalnie zmień FRONTEND_PORT cp .env.example .env # opcjonalnie zmień FRONTEND_PORT
cd /home/m3gan/.hermes/agencja-ai-com/site-agency-ai-dev/ cd /home/tomasz-syn-grzegorza/Pulpit/cursor/site-agencja-ai-com/
docker compose up -d --build docker compose up -d --build
# Strona na http://localhost:${FRONTEND_PORT} (domyślnie 8080) # Strona na http://localhost:${FRONTEND_PORT} (domyślnie 8081)
``` ```
### 2. Dokploy deployment (docker-compose-example/) ### 2. Dokploy deployment (docker-compose-example/)
+2 -2
View File
@@ -13,7 +13,7 @@
services: services:
frontend: frontend:
image: nginx:1.27-alpine image: nginx:1.27-alpine
container_name: agencja-ai-frontend container_name: agencja-ai-com-frontend
restart: unless-stopped restart: unless-stopped
ports: ports:
- "${FRONTEND_PORT:-8080}:80" - "${FRONTEND_PORT:-8080}:80"
@@ -22,7 +22,7 @@ services:
sh -c " sh -c "
apk add --no-cache git && apk add --no-cache git &&
rm -rf /app && rm -rf /app &&
git clone https://gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/site-agency-ai-dev.git /app && git clone https://gitea.expert-it.agency-ai.dev/tomasz-syn-grzegorza/site-agencja-ai-com.git /app &&
cp /app/index.html /usr/share/nginx/html/index.html && cp /app/index.html /usr/share/nginx/html/index.html &&
cp /app/site.webmanifest /usr/share/nginx/html/site.webmanifest && cp /app/site.webmanifest /usr/share/nginx/html/site.webmanifest &&
cp -r /app/assets /usr/share/nginx/html/assets && cp -r /app/assets /usr/share/nginx/html/assets &&
+12
View File
@@ -0,0 +1,12 @@
# Lokalny dev: pliki z dysku → nginx (bez rebuildu po każdej zmianie)
# Uruchomienie: docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
services:
frontend:
image: nginx:1.27-alpine
build: !reset null
volumes:
- ./index.html:/usr/share/nginx/html/index.html:ro
- ./site.webmanifest:/usr/share/nginx/html/site.webmanifest:ro
- ./assets:/usr/share/nginx/html/assets:ro
- ./default.conf:/etc/nginx/conf.d/default.conf:ro
+1 -1
View File
@@ -6,7 +6,7 @@ services:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: agencja-ai-frontend container_name: agencja-ai-com-frontend
restart: unless-stopped restart: unless-stopped
ports: ports:
- "${FRONTEND_PORT:-8080}:80" - "${FRONTEND_PORT:-8080}:80"