Make Docker Compose Coolify-ready
This commit is contained in:
@@ -3,13 +3,13 @@ services:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: fiscal
|
||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-fiscal}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d fiscal"]
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-fiscal}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
@@ -21,19 +21,22 @@ services:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- path: ./.env
|
||||
required: false
|
||||
- path: ../.env
|
||||
required: false
|
||||
environment:
|
||||
DATABASE_URL: postgres://postgres:postgres@postgres:5432/fiscal
|
||||
PORT: 3001
|
||||
JWT_SECRET: change-this-to-a-random-secret-key
|
||||
GITHUB_ID: ${GITHUB_ID}
|
||||
GITHUB_SECRET: ${GITHUB_SECRET}
|
||||
GOOGLE_ID: ${GOOGLE_ID}
|
||||
GOOGLE_SECRET: ${GOOGLE_SECRET}
|
||||
DATABASE_URL: ${DATABASE_URL:-postgres://postgres:postgres@postgres:5432/fiscal}
|
||||
PORT: ${PORT:-3001}
|
||||
POSTGRES_HOST: postgres
|
||||
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:-local-dev-better-auth-secret-change-me}
|
||||
BETTER_AUTH_BASE_URL: ${BETTER_AUTH_BASE_URL:-http://localhost:3001}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "bun", "-e", "require('http').createServer(() => {}).listen(3001)"]
|
||||
test: ["CMD-SHELL", "wget -q --spider http://localhost:3001/api/health || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
@@ -44,9 +47,11 @@ services:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://backend:3001}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
NEXT_PUBLIC_API_URL: http://backend:3001
|
||||
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://backend:3001}
|
||||
depends_on:
|
||||
- backend
|
||||
networks:
|
||||
|
||||
Reference in New Issue
Block a user