-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
107 lines (103 loc) · 3.34 KB
/
Copy pathdocker-compose.yml
File metadata and controls
107 lines (103 loc) · 3.34 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
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: agent_tasks
POSTGRES_PASSWORD: agent_tasks
POSTGRES_DB: agent_tasks
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U agent_tasks -d agent_tasks"]
interval: 5s
timeout: 3s
retries: 10
# Optional: enables the RedisCache backend for services/cache.ts. When
# the backend is run without REDIS_URL set it transparently falls back
# to an in-memory cache, so local dev without this service keeps
# working. Set REDIS_URL=redis://redis:6379 in .env to opt in.
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
backend:
build:
context: .
dockerfile: backend/Dockerfile
target: dev
working_dir: /app
env_file:
- .env
environment:
NODE_ENV: development
PORT: 3001
DATABASE_URL: postgresql://agent_tasks:agent_tasks@db:5432/agent_tasks
FRONTEND_URL: http://localhost:3000
CORS_ORIGINS: http://localhost:3000
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID:-dev-client-id}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET:-dev-client-secret}
# No dev default: the backend rejects a secret shorter than 32 chars, so
# an unset value fails loud at startup instead of silently running on a
# predictable secret. Set SESSION_SECRET in .env (generate one with:
# openssl rand -hex 32).
SESSION_SECRET: ${SESSION_SECRET}
# Disk location for human-uploaded task attachments (image + text). The
# uploads_data volume mounted below at /app/uploads overlays the repo
# bind mount so uploaded files stay out of the working tree.
UPLOAD_DIR: /app/uploads
# Uncomment the block below (and the matching depends_on line
# further down) to share the GitHub-checks cache across multiple
# backend instances. The `redis` service above provides the
# endpoint. Without REDIS_URL, the backend silently falls back to
# its in-memory cache.
# REDIS_URL: redis://redis:6379
# REDIS_KEY_PREFIX: agent-tasks:
command: >
bash -lc "npm run db:generate --workspace=backend &&
npm run db:push --workspace=backend &&
npm run dev --workspace=backend"
volumes:
- ./:/app
- backend_node_modules:/app/node_modules
- uploads_data:/app/uploads
ports:
- "3001:3001"
depends_on:
db:
condition: service_healthy
# Uncomment together with REDIS_URL above:
# redis:
# condition: service_healthy
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
target: dev
working_dir: /app
env_file:
- .env
environment:
NODE_ENV: development
NEXT_PUBLIC_API_URL: http://localhost:3001
command: bash -lc "npm run dev --workspace=frontend"
volumes:
- ./:/app
- frontend_node_modules:/app/node_modules
ports:
- "3000:3000"
depends_on:
- backend
volumes:
postgres_data:
backend_node_modules:
frontend_node_modules:
# Human-uploaded task attachments (image + text), kept out of the repo
# working tree by overlaying the backend bind mount at /app/uploads.
uploads_data: