forked from felton/email-agent-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (57 loc) · 1.53 KB
/
Copy pathdocker-compose.yml
File metadata and controls
58 lines (57 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
services:
app:
build:
context: .
dockerfile: Dockerfile
# Expose port 3000 when running with the "direct" (local) or "dev" profile.
profiles: ["direct", "dev"]
ports:
- "3000:3000"
env_file:
- .env
environment:
- NODE_ENV=production
depends_on:
db:
condition: service_healthy
db:
image: pgvector/pgvector:pg15
env_file:
- .env
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=email_agent
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
caddy:
# Caddy only runs when the 'prod' profile is active
profiles: ["prod"]
build:
context: .
dockerfile: Dockerfile.caddy
restart: unless-stopped
ports:
# Map host port 3000 to container port 443 (for HTTPS via passthrough)
- "3000:443"
# Map host port 8080 to container port 80 (for potential HTTP challenges/redirects)
- "8080:80"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile # Mount the Caddyfile
- caddy_data:/data # Persist certificates and Caddy state
# Pass environment variables needed for DNS challenge
env_file:
- .env
environment:
- CLOUDFLARE_API_TOKEN=${CLOUDFLARE_API_TOKEN}
depends_on:
- app # Wait for the app service to be ready (optional but recommended)
volumes:
db_data:
caddy_data: # Define the volume for Caddy data