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:
+1
-1
@@ -5,4 +5,4 @@
|
||||
# --- Frontend Server ---
|
||||
# Port na hoście (localhost). W kontenerze nginx zawsze nasłuchuje na 80.
|
||||
# Mapowanie w docker-compose.yml: ${FRONTEND_PORT}:80
|
||||
FRONTEND_PORT=8080
|
||||
FRONTEND_PORT=8081
|
||||
|
||||
@@ -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
|
||||
@@ -6,4 +6,4 @@
|
||||
# Port publikowany na hoście. W kontenerze nginx zawsze nasłuchuje na 80.
|
||||
# Mapowanie w docker-compose.yml: ${FRONTEND_PORT}:80
|
||||
# Dokploy/Traefik dodatkowo routuje po FQDN do wewnętrznego portu 80 kontenera.
|
||||
FRONTEND_PORT=8080
|
||||
FRONTEND_PORT=8081
|
||||
|
||||
@@ -5,7 +5,7 @@ Strona internetowa ze statycznym obrazem tła od pierwszej klatki i krótkim int
|
||||
## Struktura projektu
|
||||
|
||||
```
|
||||
site-agency-ai-dev/
|
||||
site-agencja-ai-com/
|
||||
├── docker-compose.yml # Lokalny dev (build: context .)
|
||||
├── Dockerfile # Kontener nginx 1.27 Alpine
|
||||
├── default.conf # Konfiguracja nginx
|
||||
@@ -29,9 +29,9 @@ Używa `build:` z Dockerfile — buduje obraz lokalnie. Port hosta ustawiasz w `
|
||||
|
||||
```bash
|
||||
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
|
||||
# Strona na http://localhost:${FRONTEND_PORT} (domyślnie 8080)
|
||||
# Strona na http://localhost:${FRONTEND_PORT} (domyślnie 8081)
|
||||
```
|
||||
|
||||
### 2. Dokploy deployment (docker-compose-example/)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
services:
|
||||
frontend:
|
||||
image: nginx:1.27-alpine
|
||||
container_name: agencja-ai-frontend
|
||||
container_name: agencja-ai-com-frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${FRONTEND_PORT:-8080}:80"
|
||||
@@ -22,7 +22,7 @@ services:
|
||||
sh -c "
|
||||
apk add --no-cache git &&
|
||||
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/site.webmanifest /usr/share/nginx/html/site.webmanifest &&
|
||||
cp -r /app/assets /usr/share/nginx/html/assets &&
|
||||
|
||||
@@ -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
@@ -6,7 +6,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: agencja-ai-frontend
|
||||
container_name: agencja-ai-com-frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${FRONTEND_PORT:-8080}:80"
|
||||
|
||||
Reference in New Issue
Block a user