diff --git a/docker-compose.coolify.yml b/docker-compose.coolify.yml new file mode 100644 index 0000000..908cd77 --- /dev/null +++ b/docker-compose.coolify.yml @@ -0,0 +1,67 @@ +version: '3.9' + +services: + db: + image: postgres:16-alpine + restart: unless-stopped + environment: + POSTGRES_DB: freetable + POSTGRES_USER: freetable + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + volumes: + - freetable-db-data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U freetable"] + interval: 10s + timeout: 5s + retries: 5 + labels: + - "co.anonymous=*" + - "co.logdrain=* + + backend: + build: + context: ./backend + dockerfile: Dockerfile + restart: unless-stopped + environment: + DATABASE_URL: postgresql://freetable:${POSTGRES_PASSWORD}@db:5432/freetable + SECRET_KEY: ${SECRET_KEY} + CORS_ORIGINS: ${CORS_ORIGINS} + APP_NAME: FreeTable + APP_VERSION: 1.0.0 + DEBUG: "false" + depends_on: + db: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + labels: + - "co.anonymous=*" + - "co.logdrain=*" + + frontend: + image: nginx:alpine + restart: unless-stopped + volumes: + - ./frontend/dist:/usr/share/nginx/html:ro + - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro + ports: + - "80:80" + depends_on: + - backend + healthcheck: + test: ["CMD", "wget", "-q", "--spider", "http://localhost/health"] + interval: 30s + timeout: 10s + retries: 3 + labels: + - "co.anonymous=*" + - "co.logdrain=*" + +volumes: + freetable-db-data: