diff --git a/olhar-api/docker-compose.yml b/olhar-api/docker-compose.yml new file mode 100644 index 0000000..08eef74 --- /dev/null +++ b/olhar-api/docker-compose.yml @@ -0,0 +1,54 @@ +name: olhar-api-stack + +services: + db: + image: postgres:16-alpine + container_name: olhar-api-db + restart: unless-stopped + environment: + POSTGRES_DB: olhar + POSTGRES_USER: olhar + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + TZ: Europe/Paris + healthcheck: + test: ["CMD-SHELL", "pg_isready -U olhar -d olhar"] + interval: 10s + timeout: 5s + retries: 5 + volumes: + - ~/Applications/data/olhar-api/db_data:/var/lib/postgresql/data + networks: + - olhar-api-net + + api: + image: git.goutailler-olivier.com/gato/olhar-api:latest + container_name: olhar-api + restart: unless-stopped + depends_on: + db: + condition: service_healthy + environment: + DATASOURCE_URL: jdbc:postgresql://db:5432/olhar + DATASOURCE_USERNAME: olhar + DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD} + KEYCLOAK_JWKS_URI: https://auth.goutailler-olivier.com/realms/olhar/protocol/openid-connect/certs + CORS_ALLOWED_ORIGIN_PROD: https://olhar.goutailler-olivier.com + TZ: Europe/Paris + networks: + - olhar-api-net + - proxy + labels: + - traefik.enable=true + - traefik.http.routers.olhar-api.rule=Host(`olhar.goutailler-olivier.com`) && PathPrefix(`/api`) + - traefik.http.routers.olhar-api.entrypoints=websecure + - traefik.http.routers.olhar-api.tls.certresolver=le + - traefik.http.services.olhar-api.loadbalancer.server.port=8080 + - traefik.docker.network=proxy + - com.centurylinklabs.watchtower.enable=true + +networks: + olhar-api-net: + driver: bridge + proxy: + external: true + name: proxy