version: '3' services: postgres: image: postgres:14.2-alpine container_name: postgres ports: - 5432:5432 env_file: .env volumes: - ./scripts/database/initialize.sql:/docker-entrypoint-initdb.d/initialize.sql - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres" ] interval: 30s timeout: 30s start_period: 15s retries: 3 restart: always traefik: image: traefik container_name: traefik command: - --providers.docker=true - --providers.docker.exposedbydefault=false - --entrypoints.web.address=:80 ports: - 80:80 volumes: - /var/run/docker.sock:/var/run/docker.sock:ro server: build: context: . dockerfile: server/Dockerfile container_name: server env_file: .env environment: - PUBLIC_URL=http://localhost - POSTGRES_HOST=postgres - POSTGRES_DATABASE=reactive_resume depends_on: - traefik - postgres labels: - traefik.enable=true - traefik.http.routers.server.entrypoints=web - traefik.http.routers.server.rule=Host(`localhost`) && PathPrefix(`/api/`) - traefik.http.routers.server.middlewares=server-stripprefix - traefik.http.middlewares.server-stripprefix.stripprefix.prefixes=/api - traefik.http.middlewares.server-stripprefix.stripprefix.forceslash=true client: build: context: . dockerfile: client/Dockerfile container_name: client env_file: .env environment: - PUBLIC_SERVER_URL=http://localhost/api depends_on: - traefik - server labels: - traefik.enable=true - traefik.http.routers.client.rule=Host(`localhost`) - traefik.http.routers.client.entrypoints=web volumes: pgdata: