-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
131 lines (125 loc) · 4.25 KB
/
docker-compose.yml
File metadata and controls
131 lines (125 loc) · 4.25 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# =============================================================================
# Archon - Docker Compose
# =============================================================================
#
# Usage:
# docker compose up -d # App with SQLite (default)
# docker compose --profile with-db up -d # App + local PostgreSQL
# docker compose --profile cloud up -d # App + Caddy HTTPS reverse proxy
# docker compose --profile with-db --profile cloud up -d # All three
#
# Database:
# SQLite is the default (zero config). For PostgreSQL, either:
# - Use --profile with-db for a local container, and set in .env:
# DATABASE_URL=postgresql://postgres:postgres@postgres:5432/remote_coding_agent
# - Or point DATABASE_URL to an external database (Supabase, Neon, etc.)
#
# Data:
# Set ARCHON_DATA in .env to control where Archon stores data on the host:
# ARCHON_DATA=/opt/archon-data # Any absolute path on the host
# Default: Docker-managed volume (archon_data)
#
# Cloud (HTTPS):
# 1. Set DOMAIN=archon.example.com in .env
# 2. Point DNS A record to your server
# 3. Add --profile cloud — Caddy handles TLS automatically via Let's Encrypt
#
services:
# -------------------------------------------------------------------------
# App (always runs)
# -------------------------------------------------------------------------
app:
build: .
image: archon
env_file: .env
environment:
ARCHON_DOCKER: "true"
ports:
- "${PORT:-3000}:${PORT:-3000}"
volumes:
- ${ARCHON_DATA:-archon_data}:/.archon
networks:
- archon-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${PORT:-3000}/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
dns:
- 8.8.8.8
- 8.8.4.4
sysctls:
- net.ipv6.conf.all.disable_ipv6=1
# -------------------------------------------------------------------------
# PostgreSQL (optional: --profile with-db)
# Set DATABASE_URL in .env to connect the app to this container.
# -------------------------------------------------------------------------
postgres:
image: postgres:17-alpine
profiles: ["with-db"]
environment:
POSTGRES_DB: remote_coding_agent
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations/000_combined.sql:/docker-entrypoint-initdb.d/000_combined.sql:ro
- ./migrations:/migrations:ro
ports:
- "127.0.0.1:${POSTGRES_PORT:-5432}:5432"
networks:
- archon-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
# -------------------------------------------------------------------------
# Caddy reverse proxy with automatic HTTPS (optional: --profile cloud)
# Requires DOMAIN set in .env. See Caddyfile for configuration.
# -------------------------------------------------------------------------
caddy:
image: caddy:2-alpine
profiles: ["cloud"]
restart: unless-stopped
env_file: .env
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
networks:
- archon-network
depends_on:
app:
condition: service_healthy
# -------------------------------------------------------------------------
# Auth service — form-based login for Caddy forward_auth (optional: --profile auth)
# Use alongside --profile cloud: docker compose --profile cloud --profile auth up -d
# Requires AUTH_USERNAME, AUTH_PASSWORD_HASH, COOKIE_SECRET in .env.
# See docs/docker.md for setup instructions.
# -------------------------------------------------------------------------
auth-service:
build: ./auth-service
profiles: ["auth"]
restart: unless-stopped
env_file: .env
environment:
AUTH_PORT: "${AUTH_SERVICE_PORT:-9000}"
expose:
- "${AUTH_SERVICE_PORT:-9000}"
networks:
- archon-network
volumes:
archon_data:
postgres_data:
caddy_data:
caddy_config:
networks:
archon-network:
driver: bridge