Final fix: complete rewrite of compose for swarm

This commit is contained in:
Sidney 2026-04-19 16:54:41 -03:00
parent 2f2172a4f5
commit 429e827857
1 changed files with 2 additions and 50 deletions

View File

@ -14,8 +14,6 @@ services:
volumes: volumes:
- pgdata:/var/lib/postgresql/data - pgdata:/var/lib/postgresql/data
- ./schema.sql:/docker-entrypoint-initdb.d/01_schema.sql - ./schema.sql:/docker-entrypoint-initdb.d/01_schema.sql
ports:
- "5432:5432"
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U edumanager"] test: ["CMD-SHELL", "pg_isready -U edumanager"]
interval: 10s interval: 10s
@ -36,14 +34,6 @@ services:
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-MiniO2026!Seguro} MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-MiniO2026!Seguro}
volumes: volumes:
- miniodata:/data - miniodata:/data
ports:
- "9000:9000" # API S3
- "9001:9001" # Console Web
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 5
networks: networks:
- edumanager-internal - edumanager-internal
- traefik-public - traefik-public
@ -55,37 +45,11 @@ services:
- "traefik.http.routers.minio.tls.certresolver=letsencrypt" - "traefik.http.routers.minio.tls.certresolver=letsencrypt"
- "traefik.http.services.minio.loadbalancer.server.port=9000" - "traefik.http.services.minio.loadbalancer.server.port=9000"
# Cria os buckets automaticamente na primeira vez
minio-init:
image: minio/mc:latest
depends_on:
- minio
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 $${MINIO_ROOT_USER:-minioadmin} $${MINIO_ROOT_PASSWORD:-MiniO2026!Seguro};
mc mb --ignore-existing local/fotos-alunos;
mc mb --ignore-existing local/documentos;
mc mb --ignore-existing local/atestados;
mc mb --ignore-existing local/logos;
mc mb --ignore-existing local/exames;
mc mb --ignore-existing local/carnes;
mc anonymous set download local/fotos-alunos;
mc anonymous set download local/documentos;
mc anonymous set download local/logos;
mc anonymous set download local/exames;
mc anonymous set download local/carnes;
echo '✅ Buckets criados com sucesso!';
"
networks:
- edumanager-internal
# ============================ # ============================
# EDUMANAGER (PAINEL ADMIN) # EDUMANAGER (PAINEL ADMIN)
# ============================ # ============================
edumanager: edumanager:
build: image: edumanager-app:latest
context: ./manager
dockerfile: Dockerfile
restart: always restart: always
depends_on: depends_on:
- postgres - postgres
@ -107,10 +71,6 @@ services:
- edumanager-internal - edumanager-internal
- traefik-public - traefik-public
deploy: deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.edumanager.rule=Host(`edumanager.microtecinformaticacurso.com.br`)" - "traefik.http.routers.edumanager.rule=Host(`edumanager.microtecinformaticacurso.com.br`)"
@ -122,9 +82,7 @@ services:
# PORTAL DO ALUNO # PORTAL DO ALUNO
# ============================ # ============================
portalaluno: portalaluno:
build: image: portalaluno-app:latest
context: ./portal
dockerfile: Dockerfile
restart: always restart: always
depends_on: depends_on:
- postgres - postgres
@ -142,10 +100,6 @@ services:
- edumanager-internal - edumanager-internal
- traefik-public - traefik-public
deploy: deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.portalaluno.rule=Host(`portal.microtecinformaticacurso.com.br`)" - "traefik.http.routers.portalaluno.rule=Host(`portal.microtecinformaticacurso.com.br`)"
@ -155,9 +109,7 @@ services:
volumes: volumes:
pgdata: pgdata:
driver: local
miniodata: miniodata:
driver: local
networks: networks:
edumanager-internal: edumanager-internal: