Hier ist das Docker-Compose:
Code: Select all
services:
newsseo:
image: ${DOCKER_REGISTRY-}newsseo
build:
context: .
dockerfile: NewsSEO/Dockerfile
depends_on:
newsseo-api:
condition: service_healthy
newsseo-api:
image: ${DOCKER_REGISTRY-}newsseoapi
build:
context: .
dockerfile: NewsSEO.API/Dockerfile
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -k -f https://localhost:8081/health || exit 1"]
interval: 10s
timeout: 10s
retries: 3
postgres:
image: postgres:18.0
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: "admin123"
POSTGRES_USER: "admin"
POSTGRES_DB: "news_db"
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 10s
retries: 3
Code: Select all
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
USER root
RUN apt-get update && apt-get install -y curl
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
Dinge, die ich bereits versucht habe:
- Ändern von https 8081 zu http 8080 im Healthcheck.
- Erhöhung des Intervalls, Timeout und start_period.
- Hinzufügen von restart: on-failure zu beiden Diensten.
Mobile version