diff --git a/.gitignore b/.gitignore index 5d2dfa9..5cde975 100644 --- a/.gitignore +++ b/.gitignore @@ -54,5 +54,8 @@ projektverwaltung/frontend wichteln/backend wichteln/frontend gravcms/sportakrobatik-dobersberg +gastro/backend +gastro/frontend -beszel/beszel_data/id_ed25519 \ No newline at end of file +beszel/beszel_data/ +owncast/data \ No newline at end of file diff --git a/gastro/compose.yaml b/gastro/compose.yaml new file mode 100644 index 0000000..0cab0b9 --- /dev/null +++ b/gastro/compose.yaml @@ -0,0 +1,46 @@ +services: + backend: + build: + context: ./backend + image: gastro-backend:latest + container_name: gastro-backend + restart: unless-stopped + environment: + DATABASE_URL: ${DATABASE_URL} + DATABASE_USER: ${DATABASE_USER} + DATABASE_PASSWORD: ${DATABASE_PASSWORD} + + JWT_SECRET: ${JWT_SECRET} + labels: + - "traefik.enable=true" + - "traefik.docker.network=traefik-network" + - "traefik.http.routers.gastro-backend.rule=Host(`api-gastro.byhaider.dev`)" + - "traefik.http.routers.gastro-backend.entrypoints=websecure" + - "traefik.http.routers.gastro-backend.tls=true" + - "traefik.http.routers.gastro-backend.tls.certResolver=cloudflare" + - "traefik.http.services.gastro-backend.loadbalancer.server.port=8080" + networks: + - postgresql + - traefik-network + + frontend: + build: + context: ./frontend + image: gastro-frontend:latest + container_name: gastro-frontend + restart: unless-stopped + labels: + - "traefik.enable=true" + - "traefik.http.routers.gastro-frontend.rule=Host(`gastro.byhaider.dev`)" + - "traefik.http.routers.gastro-frontend.entrypoints=websecure" + - "traefik.http.routers.gastro-frontend.tls=true" + - "traefik.http.routers.gastro-frontend.tls.certResolver=cloudflare" + - "traefik.http.services.gastro-frontend.loadbalancer.server.port=80" + networks: + - traefik-network + +networks: + traefik-network: + external: true + postgresql: + external: true \ No newline at end of file diff --git a/gastro/deploy.sh b/gastro/deploy.sh new file mode 100755 index 0000000..590f2b0 --- /dev/null +++ b/gastro/deploy.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -e + +echo "πŸš€ Starte Deployment fΓΌr Projektverwaltung..." + +cd ~/docker-setup/projektverwaltung + +echo "πŸ“₯ Pull latest changes for backend..." +cd backend +git pull origin main + +echo "πŸ“₯ Pull latest changes for frontend..." +cd ../frontend +git pull origin main + +cd .. + +echo "πŸ›‘ Stoppe alte Container..." +docker compose down + +echo "πŸ“¦ Baue Images neu..." +docker compose build + +echo "⬆️ Starte Container..." +docker compose up -d + +echo "🧹 Bereinige alte Images..." +docker image prune -f + +echo "βœ… Deployment abgeschlossen!" +docker compose ps +