Add Dockerfile + docker-compose for Coolify deployment
Multi-stage build: node builds the SPA, dotnet publishes the API, the runtime image serves the SPA from wwwroot/ and exposes /health. Frontend Supabase URL + publishable key are baked in at build time; DB conn string and Supabase JWKS metadata come from Coolify env vars. VITE_API_URL empty means same-origin, so the browser hits /api/todos on the same host that serves the SPA.
This commit is contained in:
25
docker-compose.yml
Normal file
25
docker-compose.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
VITE_SUPABASE_URL: ${VITE_SUPABASE_URL}
|
||||
VITE_SUPABASE_PUBLISHABLE_KEY: ${VITE_SUPABASE_PUBLISHABLE_KEY}
|
||||
VITE_API_URL: ""
|
||||
expose:
|
||||
- "8080"
|
||||
environment:
|
||||
SERVICE_FQDN_APP_8080: /
|
||||
ASPNETCORE_ENVIRONMENT: Production
|
||||
ASPNETCORE_URLS: "http://+:8080"
|
||||
ConnectionStrings__Postgres: ${DB_CONNECTION_STRING}
|
||||
Supabase__MetadataAddress: ${SUPABASE_METADATA_ADDRESS}
|
||||
Supabase__Issuer: ${SUPABASE_ISSUER}
|
||||
Supabase__Audience: authenticated
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 20s
|
||||
Reference in New Issue
Block a user