-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (122 loc) · 3.26 KB
/
docker-compose.yml
File metadata and controls
126 lines (122 loc) · 3.26 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
# ResearchOS Docker Compose
# Ports:
# - Frontend: 127.0.0.1:3002
# - Backend API: 127.0.0.1:8002
# Usage:
# 1) cp .env.example .env
# 2) docker compose up -d --build
# 3) Open http://localhost:3002
# For public/shared deployments, set APP_ENV=prod plus AUTH_PASSWORD_HASH and
# AUTH_SECRET_KEY before exposing these ports beyond localhost.
services:
backend:
image: ${BACKEND_IMAGE:-researchos-backend:latest}
build:
context: .
dockerfile: Dockerfile.backend
args:
BASE_REGISTRY: ${BASE_REGISTRY:-docker.io}
APT_MIRROR: ${APT_MIRROR:-}
container_name: researchos-backend
ports:
- "${BACKEND_PORT_BIND:-127.0.0.1:8002}:8000"
volumes:
- pm_data:/app/data
- pm_logs:/app/logs
- ./apps:/app/apps:ro
- ./packages:/app/packages:ro
- ./scripts:/app/scripts:ro
- ./infra:/app/infra:ro
- ./alembic.ini:/app/alembic.ini:ro
- ./pyproject.toml:/app/pyproject.toml:ro
- pm_pip_cache:/.pip-cache
env_file:
- ./.env
environment:
- APP_ENV=${APP_ENV:-dev}
- API_HOST=0.0.0.0
- API_PORT=8000
- SITE_URL=${SITE_URL:-http://localhost:3002}
- CORS_ALLOW_ORIGINS=${CORS_ALLOW_ORIGINS:-http://localhost:3002,http://127.0.0.1:3002}
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000/health"]
interval: 30s
timeout: 5s
start_period: 40s
retries: 3
deploy:
resources:
limits:
cpus: "2.0"
memory: 2G
reservations:
cpus: "0.5"
memory: 512M
worker:
image: ${BACKEND_IMAGE:-researchos-backend:latest}
container_name: researchos-worker
command: python -m apps.worker.main
volumes:
- pm_data:/app/data
- pm_logs:/app/logs
- ./apps:/app/apps:ro
- ./packages:/app/packages:ro
- ./scripts:/app/scripts:ro
- ./infra:/app/infra:ro
- ./alembic.ini:/app/alembic.ini:ro
- ./pyproject.toml:/app/pyproject.toml:ro
- pm_pip_cache:/.pip-cache
env_file:
- ./.env
environment:
- APP_ENV=${APP_ENV:-dev}
- SITE_URL=${SITE_URL:-http://localhost:3002}
restart: unless-stopped
depends_on:
- backend
healthcheck:
test: ["CMD", "test", "-f", "/app/data/worker_heartbeat"]
interval: 30s
timeout: 5s
start_period: 40s
retries: 3
deploy:
resources:
limits:
cpus: "2.0"
memory: 2G
reservations:
cpus: "0.5"
memory: 512M
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
BASE_REGISTRY: ${BASE_REGISTRY:-docker.io}
NPM_REGISTRY: ${NPM_REGISTRY:-https://registry.npmjs.org}
container_name: researchos-frontend
ports:
- "${FRONTEND_PORT_BIND:-127.0.0.1:3002}:80"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:80"]
interval: 30s
timeout: 5s
start_period: 10s
retries: 3
deploy:
resources:
limits:
cpus: "0.5"
memory: 256M
reservations:
cpus: "0.1"
memory: 64M
volumes:
pm_data:
name: researchos_data
pm_logs:
name: researchos_logs
pm_pip_cache: