diff --git a/docker-compose.yml b/docker-compose.yml index 0a9c690..ca9fe6c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,10 @@ services: expose: - "3001" volumes: - - ./data:/app/data + # Named volume (not a relative bind mount): Coolify resolves it under the + # resource's managed storage and it survives redeploys without the + # convert-to-directory bind-mount pitfalls. + - b2b_data:/app/data environment: - NODE_ENV=production # SQLite file inside the mounted volume so data survives redeploys. @@ -51,28 +54,25 @@ services: mem_limit: 128m cpus: "0.5" healthcheck: - # nginx:alpine has busybox wget. - test: ["CMD", "wget", "--spider", "-q", "http://localhost:80/"] + # nginx:alpine has busybox wget. Use 127.0.0.1 (not localhost): localhost + # resolves to ::1 first and nginx listens IPv4-only, so wget would fail + # forever, the container would never go healthy, and Traefik would drop it + # from the load balancer (503 "no available server"). + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:80/"] interval: 30s timeout: 5s retries: 3 start_period: 10s - networks: - - default - - coolify - labels: - - traefik.enable=true - - "traefik.http.routers.b2b-web.rule=Host(`b2b.nxssie.dev`)" - - traefik.http.routers.b2b-web.entrypoints=websecure - - traefik.http.routers.b2b-web.tls=true - - traefik.http.routers.b2b-web.tls.certresolver=letsencrypt - - traefik.http.services.b2b-web.loadbalancer.server.port=80 + # No custom networks and no hardcoded Traefik labels: Coolify auto-creates + # the per-stack network, attaches its proxy, and generates the correct + # routers/TLS when you set this service's domain (https://b2b.nxssie.dev) in + # the Coolify UI. Declaring our own network or labels here would multi-home + # the container (intermittent 504s) and collide with Coolify's generated set. logging: driver: json-file options: max-size: "10m" max-file: "3" -networks: - coolify: - external: true +volumes: + b2b_data: