CHANGE docker-compose to use the portainer stack definition

This commit is contained in:
2026-05-06 11:05:34 +02:00
parent 57c075eb25
commit e57eb7277f
2 changed files with 50 additions and 25 deletions

View File

@@ -8,7 +8,7 @@ while true; do
FILENAME="${BACKUP_DIR}/strichliste_${TIMESTAMP}.sql.gz" FILENAME="${BACKUP_DIR}/strichliste_${TIMESTAMP}.sql.gz"
echo "[$(date)] Starting backup..." echo "[$(date)] Starting backup..."
mariadb-dump -h db -u strichliste -pstrichliste strichliste | gzip > "${FILENAME}" mariadb-dump -h db -u strichliste -pstrichliste --single-transaction --skip-lock-tables strichliste | gzip > "${FILENAME}"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "[$(date)] Backup saved: ${FILENAME}" echo "[$(date)] Backup saved: ${FILENAME}"

View File

@@ -1,50 +1,73 @@
version: "3"
volumes:
db-data:
services: services:
db: db:
image: mariadb:11.4 image: mariadb:11.4
container_name: qaffee-db
restart: always
command: --log-warnings=3
environment: environment:
MARIADB_ROOT_PASSWORD: rootpassword - "MARIADB_ROOT_PASSWORD=rootpassword"
MARIADB_DATABASE: strichliste - "MARIADB_DATABASE=strichliste"
MARIADB_USER: strichliste - "MARIADB_USER=strichliste"
MARIADB_PASSWORD: strichliste - "MARIADB_PASSWORD=strichliste"
ports:
- "3306:3306"
volumes: volumes:
- db-data:/var/lib/mysql - db-data:/var/lib/mysql
- ./db/seed.sql:/docker-entrypoint-initdb.d/seed.sql
healthcheck: healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
networks:
- traefik-net
backend: backend:
build: ./backend build: ./backend
container_name: qaffee-backend
environment: environment:
QUARKUS_DATASOURCE_JDBC_URL: jdbc:mariadb://db:3306/strichliste - "QUARKUS_DATASOURCE_JDBC_URL=jdbc:mariadb://db:3306/strichliste"
QUARKUS_DATASOURCE_USERNAME: strichliste - "QUARKUS_DATASOURCE_USERNAME=strichliste"
QUARKUS_DATASOURCE_PASSWORD: strichliste - "QUARKUS_DATASOURCE_PASSWORD=strichliste"
QUARKUS_HTTP_CORS_ORIGINS: http://localhost:5173,http://localhost:4173 - "QUARKUS_HTTP_CORS_ORIGINS=https://qaffee.cloud.aquantico.de"
ports: labels:
- "8080:8080" traefik.enable: "true"
traefik.docker.network: "traefik-net"
traefik.http.routers.qaffee-backend.entrypoints: "websecure"
traefik.http.routers.qaffee-backend.rule: "Host(`qaffee-api.cloud.aquantico.de`)"
traefik.http.routers.qaffee-backend.tls: "true"
traefik.http.routers.qaffee-backend.tls.certresolver: "myresolver"
traefik.http.services.qaffee-backend.loadbalancer.server.port: 8080
depends_on: depends_on:
db: db:
condition: service_healthy condition: service_healthy
networks:
- traefik-net
frontend: frontend:
build: ./frontend build: ./frontend
container_name: qaffee-frontend
environment: environment:
API_URL: http://backend:8080 - "API_URL=http://backend:8080"
ports: ports:
- "3000:3000" - "3000:3000"
labels:
traefik.enable: "true"
traefik.docker.network: "traefik-net"
traefik.http.routers.qaffee-frontend.entrypoints: "websecure"
traefik.http.routers.qaffee-frontend.rule: "Host(`qaffee.cloud.aquantico.de`)"
traefik.http.routers.qaffee-frontend.tls: "true"
traefik.http.routers.qaffee-frontend.tls.certresolver: "myresolver"
traefik.http.services.qaffee-frontend.loadbalancer.server.port: 3000
depends_on: depends_on:
- backend - backend
networks:
- traefik-net
backup: backup:
image: mariadb:11.4.4 image: mariadb:11.4
container_name: qaffee-backup
environment: environment:
MARIADB_HOST: db - "MARIADB_HOST=db"
MARIADB_USER: strichliste - "MARIADB_USER=strichliste"
MARIADB_PASSWORD: strichliste - "MARIADB_PASSWORD=strichliste"
volumes: volumes:
- ./backups:/backups - ./backups:/backups
- ./db/backup.sh:/backup.sh - ./db/backup.sh:/backup.sh
@@ -52,6 +75,8 @@ services:
depends_on: depends_on:
db: db:
condition: service_healthy condition: service_healthy
networks:
volumes: - traefik-net
db-data: networks:
traefik-net:
external: true