Move compose to repo root with context:. (fixes Coolify build-context path)

Coolify runs compose with --project-directory=repo-root, so context:.. resolved above the repo and the build context/Dockerfiles weren't found. Root compose + context:. matches the Dockerfiles' assumption (context = repo root).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 10:35:10 +02:00
parent 4c0af9c406
commit 1f1b69b035

View File

@@ -1,18 +1,17 @@
# Visigine — single-stack compose. Frontend (nginx) is the only ingress; # Visigine — deployment compose at the REPO ROOT so build contexts resolve
# the backend container is reachable only over the internal docker network. # correctly under Coolify (which runs compose with --project-directory = repo root).
# Frontend (nginx) is the only ingress; the backend is reachable only over the
# internal docker network. Dockerfiles live in docker/ and assume context = root.
# #
# Secrets (MISTRAL_KEY, ADMIN_TOKEN) are read from ../server/.env. # Secrets (MISTRAL_KEY, ADMIN_TOKEN, …) are injected from Coolify env vars.
# Deployment vars (NODE_ENV, ALLOWED_ORIGINS, …) are overridden here.
name: visigine name: visigine
services: services:
backend: backend:
build: build:
context: .. context: .
dockerfile: docker/backend.Dockerfile dockerfile: docker/backend.Dockerfile
# Secrets are injected from Coolify env vars (set them in the Coolify UI).
# server/.env is git-ignored and absent in Coolify's clone — so no env_file.
environment: environment:
NODE_ENV: production NODE_ENV: production
PORT: "3001" PORT: "3001"
@@ -35,12 +34,9 @@ services:
frontend: frontend:
build: build:
context: .. context: .
dockerfile: docker/frontend.Dockerfile dockerfile: docker/frontend.Dockerfile
# No host port binding: on the Coolify server host-port 8080 is already taken # No host port binding: Coolify/Traefik routes visigine.de to this port 80.
# by the Coolify/Traefik proxy. Coolify routes the domain (visigine.de) to
# this container's port 80 via Traefik. For local `docker compose` testing,
# temporarily add: ports: ["8090:80"]
expose: expose:
- "80" - "80"
depends_on: depends_on: