fix: remove PostgreSQL initialization from entrypoint and update Docker configuration for external database
Some checks failed
Build And Publish Production Image / Build And Publish Production Image (push) Failing after 2m23s

This commit is contained in:
2026-03-28 13:40:24 -03:00
parent 52ea621145
commit 942da74778
5 changed files with 25 additions and 35 deletions

View File

@@ -1,10 +1,31 @@
services:
condado-newsletter-postgress:
image: postgres:16
container_name: condado-newsletter-postgress
restart: unless-stopped
environment:
POSTGRES_DB: ${APP_DB_NAME:-condado}
POSTGRES_USER: ${SPRING_DATASOURCE_USERNAME}
POSTGRES_PASSWORD: ${SPRING_DATASOURCE_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${SPRING_DATASOURCE_USERNAME} -d ${APP_DB_NAME:-condado}"]
interval: 10s
timeout: 5s
retries: 10
condado-newsletter:
image: sancho41/condado-newsletter:latest
container_name: condado-newsletter
restart: unless-stopped
depends_on:
condado-newsletter-postgress:
condition: service_healthy
environment:
SPRING_PROFILES_ACTIVE: prod
SPRING_JPA_HIBERNATE_DDL_AUTO: ${SPRING_JPA_HIBERNATE_DDL_AUTO:-update}
SPRING_DATASOURCE_URL: jdbc:postgresql://condado-newsletter-postgress:5432/${APP_DB_NAME:-condado}
SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME}
SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD}
APP_PASSWORD: ${APP_PASSWORD}
@@ -25,8 +46,6 @@ services:
extra_hosts:
- "celtinha.desktop:host-gateway"
- "host.docker.internal:host-gateway"
volumes:
- postgres-data:/var/lib/postgresql/data
labels:
- "traefik.enable=true"
- "traefik.http.routers.condado.rule=Host(`condado-newsletter.lab`)"