Skip to content

Commit d1b1f52

Browse files
committed
production yaml cleanup
1 parent 2ff227e commit d1b1f52

File tree

4 files changed

+99
-568
lines changed

4 files changed

+99
-568
lines changed

DEPLOYMENT.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ docker pull ghcr.io/buildorin/orin-task:v1.2.3
136136
docker pull ghcr.io/buildorin/orin-web:v1.2.3
137137
138138
# Update compose files manually
139-
sed -i 's/ghcr.io\/buildorin\/orin-server:latest/ghcr.io\/buildorin\/orin-server:v1.2.3/g' /opt/orin/compose-production.yaml
140-
sed -i 's/ghcr.io\/buildorin\/orin-task:latest/ghcr.io\/buildorin\/orin-task:v1.2.3/g' /opt/orin/compose-production.yaml
141-
sed -i 's/ghcr.io\/buildorin\/orin-web:latest/ghcr.io\/buildorin\/orin-web:v1.2.3/g' /opt/orin/compose-production.yaml
139+
sed -i 's/ghcr.io\/buildorin\/orin-server:latest/ghcr.io\/buildorin\/orin-server:v1.2.3/g' compose-cpu.yaml
140+
sed -i 's/ghcr.io\/buildorin\/orin-task:latest/ghcr.io\/buildorin\/orin-task:v1.2.3/g' compose-cpu.yaml
141+
sed -i 's/ghcr.io\/buildorin\/orin-web:latest/ghcr.io\/buildorin\/orin-web:v1.2.3/g' compose-cpu.yaml
142142
143143
# Restart services
144144
sudo systemctl restart orin-app
@@ -150,12 +150,12 @@ sudo systemctl restart orin-app
150150

151151
```bash
152152
# View all service logs
153-
docker-compose -f /opt/orin/compose-production.yaml logs -f
153+
docker-compose -f compose-cpu.yaml logs -f
154154
155155
# View specific service logs
156-
docker-compose -f /opt/orin/compose-production.yaml logs -f server
157-
docker-compose -f /opt/orin/compose-production.yaml logs -f task
158-
docker-compose -f /opt/orin/compose-production.yaml logs -f web
156+
docker-compose -f compose-cpu.yaml logs -f server
157+
docker-compose -f compose-cpu.yaml logs -f task
158+
docker-compose -f compose-cpu.yaml logs -f web
159159
```
160160

161161
### Check Service Status
@@ -166,7 +166,7 @@ sudo systemctl status orin-app
166166
sudo systemctl status cloudflared-orin
167167
168168
# Docker containers
169-
docker-compose -f /opt/orin/compose-production.yaml ps
169+
docker-compose -f compose-cpu.yaml ps
170170
docker stats
171171
```
172172

@@ -260,10 +260,10 @@ For issues related to:
260260
- Added comprehensive documentation
261261

262262
# Show last 50 lines of server logs
263-
sudo docker-compose -f /opt/orin/compose-production.yaml logs --tail=50 server
263+
sudo docker-compose -f compose-cpu.yaml logs --tail=50 server
264264

265265
# Show last 50 lines of task logs
266-
sudo docker-compose -f /opt/orin/compose-production.yaml logs --tail=50 task
266+
sudo docker-compose -f compose-cpu.yaml logs --tail=50 task
267267

268268
# Show last 50 lines of keycloak logs
269-
sudo docker-compose -f /opt/orin/compose-production.yaml logs --tail=50 keycloak
269+
sudo docker-compose -f compose-cpu.yaml logs --tail=50 keycloak

compose-cpu.yaml

Lines changed: 88 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
version: '3.8'
2+
13
services:
4+
# Main API Server - Orin Build
25
server:
3-
image: luminainc/server:1.20.1
6+
image: ghcr.io/buildorin/orin-server:latest
47
ports:
58
- "8000:8000"
69
depends_on:
@@ -9,148 +12,153 @@ services:
912
- minio
1013
env_file:
1114
- .env
12-
deploy:
13-
replicas: 1
1415
restart: always
1516
volumes:
1617
- ./models.yaml:/app/models.yaml:ro
17-
18+
environment:
19+
- AUTH__KEYCLOAK_URL=https://auth.app.useorin.com
20+
- AUTH__KEYCLOAK_REALM=orin
21+
- AWS__ENDPOINT=http://minio:9000
22+
- AWS__PRESIGNED_URL_ENDPOINT=https://s3.app.useorin.com
23+
- AWS__REGION=us-east-1
24+
- LLM__MODELS_PATH=/app/models.yaml
25+
- PG__URL=postgresql://postgres:postgres@postgres:5432/chunkr
26+
- REDIS__URL=redis://redis:6379
27+
- WORKER__GENERAL_OCR_URL=http://ocr-backend:8000
28+
- WORKER__SEGMENTATION_URL=http://segmentation-backend:8000
29+
- WORKER__SERVER_URL=http://server:8000
30+
31+
# Task Workers - Orin Build
1832
task:
19-
image: luminainc/task:1.20.1
33+
image: ghcr.io/buildorin/orin-task:latest
2034
depends_on:
2135
- postgres
2236
- redis
2337
- minio
2438
env_file:
2539
- .env
26-
deploy:
27-
replicas: 10
2840
restart: always
2941
volumes:
3042
- ./models.yaml:/app/models.yaml:ro
43+
environment:
44+
- RUST_BACKTRACE=1
45+
- AWS__ACCESS_KEY=minioadmin
46+
- AWS__SECRET_KEY=minioadmin
47+
- AWS__ENDPOINT=http://minio:9000
48+
- AWS__REGION=us-east-1
49+
- WORKER__S3_BUCKET=chunkr
50+
- WORKER__SERVER_URL=http://server:8000
51+
- WORKER__SEGMENTATION_URL=http://segmentation-backend:8000
52+
- WORKER__GENERAL_OCR_URL=http://ocr-backend:8000
53+
- PG__URL=postgresql://postgres:postgres@postgres:5432/chunkr
54+
- REDIS__URL=redis://redis:6379
55+
deploy:
56+
replicas: 3
3157

58+
# Web Frontend - Orin Build
3259
web:
33-
image: luminainc/web:1.20.1
60+
image: ghcr.io/buildorin/orin-web:latest
61+
platform: linux/amd64
3462
ports:
3563
- "5173:8000"
3664
env_file:
3765
- .env
38-
environment:
39-
- VITE_FEATURE_FLAG_PIPELINE=true
40-
deploy:
41-
replicas: 1
42-
restart: always
43-
44-
segmentation:
45-
image: nginx:latest
46-
ports:
47-
- "8001:8000"
48-
volumes:
49-
- ./nginx/segmentation.conf:/etc/nginx/nginx.conf:ro
50-
- ./certs:/etc/nginx/certs:ro
51-
depends_on:
52-
- segmentation-backend
5366
restart: always
54-
67+
environment:
68+
- VITE_API_URL=https://api.app.useorin.com
69+
- VITE_DOCS_URL=https://docs.useorin.com
70+
- VITE_KEYCLOAK_CLIENT_ID=orin
71+
- VITE_KEYCLOAK_POST_LOGOUT_REDIRECT_URI=https://app.useorin.com
72+
- VITE_KEYCLOAK_REALM=orin
73+
- VITE_KEYCLOAK_REDIRECT_URI=https://app.useorin.com
74+
- VITE_KEYCLOAK_URL=https://auth.app.useorin.com
75+
76+
# Segmentation Service - Orin Build
5577
segmentation-backend:
56-
image: luminainc/segmentation-yolo-cpu:1.10.0-enterprise
78+
image: ghcr.io/buildorin/orin-segmentation:latest
5779
expose:
5880
- "8000"
59-
deploy:
60-
replicas: 6
6181
volumes:
6282
- /dev/shm:/dev/shm
6383
environment:
64-
- MAX_BATCH_SIZE=64
84+
- MAX_BATCH_SIZE=4
6585
- BATCH_WAIT_TIME=0.2
66-
- OVERLAP_THRESHOLD=0.2
67-
- SCORE_THRESHOLD=0.14
68-
- OMP_NUM_THREADS=12
69-
- MKL_NUM_THREADS=12
70-
- NUMEXPR_NUM_THREADS=12
71-
restart: always
72-
73-
ocr:
74-
image: nginx:latest
75-
ports:
76-
- "8002:8000"
77-
volumes:
78-
- ./nginx/ocr.conf:/etc/nginx/nginx.conf:ro
79-
- ./certs:/etc/nginx/certs:ro
80-
depends_on:
81-
- ocr-backend
86+
- OVERLAP_THRESHOLD=0.025
87+
- SCORE_THRESHOLD=0.2
88+
- OMP_NUM_THREADS=8
89+
- MKL_NUM_THREADS=8
90+
- NUMEXPR_NUM_THREADS=8
91+
- OPENBLAS_NUM_THREADS=8
92+
- VECLIB_MAXIMUM_THREADS=8
8293
restart: always
94+
deploy:
95+
replicas: 1
8396

97+
# OCR Service - Orin Build
8498
ocr-backend:
85-
image: luminainc/doctr-small:1.20.1
99+
image: ghcr.io/buildorin/orin-ocr:latest
86100
expose:
87101
- "8000"
88-
deploy:
89-
replicas: 3
90102
volumes:
91103
- /dev/shm:/dev/shm
104+
environment:
105+
- OCR_BATCH_WAIT_TIME=0.1
106+
- OCR_MAX_BATCH_SIZE=10
107+
- OMP_NUM_THREADS=8
108+
- MKL_NUM_THREADS=8
109+
- NUMEXPR_NUM_THREADS=8
110+
- OPENBLAS_NUM_THREADS=8
111+
- VECLIB_MAXIMUM_THREADS=8
92112
restart: always
113+
deploy:
114+
replicas: 1
93115

116+
# Database
94117
postgres:
95-
build:
96-
context: ./docker/postgres
97-
dockerfile: Dockerfile
118+
image: postgres:14
98119
environment:
99120
POSTGRES_USER: postgres
100121
POSTGRES_PASSWORD: postgres
101-
POSTGRES_DB: postgres
102-
ports:
103-
- "5432:5432"
122+
POSTGRES_DB: chunkr
104123
volumes:
105124
- postgres_data:/var/lib/postgresql/data
106125
healthcheck:
107-
test: ["CMD-SHELL", "pg_isready -U postgres"]
126+
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
108127
interval: 10s
109128
timeout: 5s
110129
retries: 5
111-
deploy:
112-
replicas: 1
113-
114-
adminer:
115-
image: adminer:latest
116-
ports:
117-
- "8082:8080"
118-
depends_on:
119-
- postgres
120130
restart: always
121131

132+
# Redis Cache
122133
redis:
123134
image: redis:latest
124-
ports:
125-
- "6379:6379"
126135
volumes:
127136
- redis_data:/data
128-
command: redis-server --appendonly yes
137+
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
129138
healthcheck:
130-
test: ["CMD", "redis-cli", "ping"]
139+
test: [ "CMD", "redis-cli", "ping" ]
131140
interval: 10s
132141
timeout: 5s
133142
retries: 5
134-
deploy:
135-
replicas: 1
143+
restart: always
136144

145+
# S3 Storage
137146
minio:
138147
image: minio/minio:latest
139-
ports:
140-
- "9000:9000"
141-
- "9001:9001"
142148
environment:
143149
MINIO_ROOT_USER: minioadmin
144150
MINIO_ROOT_PASSWORD: minioadmin
145151
volumes:
146152
- minio_data:/data
147153
command: server /data --console-address ":9001"
148154
healthcheck:
149-
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
155+
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
150156
interval: 30s
151157
timeout: 20s
152158
retries: 1
159+
restart: always
153160

161+
# MinIO Initialization
154162
minio-init:
155163
image: minio/mc
156164
depends_on:
@@ -162,27 +170,29 @@ services:
162170
/usr/bin/mc mb myminio/chunkr --ignore-existing &&
163171
/usr/bin/mc anonymous set public myminio/chunkr
164172
"
173+
restart: "no"
165174

175+
# Authentication
166176
keycloak:
167177
image: quay.io/keycloak/keycloak:25.0.2
168-
ports:
169-
- "8080:8080"
170178
environment:
171179
- KEYCLOAK_ADMIN=admin
172180
- KEYCLOAK_ADMIN_PASSWORD=admin
173181
- KC_PROXY=edge
174-
- KC_HTTP_ENABLED=true
175182
- KC_DB=postgres
183+
- KC_HOSTNAME_STRICT=false
184+
- KC_HOSTNAME_STRICT_HTTPS=false
185+
- KC_HTTP_ENABLED=true
176186
- KC_DB_URL=jdbc:postgresql://postgres:5432/keycloak
177187
- KC_DB_USERNAME=postgres
178188
- KC_DB_PASSWORD=postgres
179189
- KC_HEALTH_ENABLED=true
180190
- KC_TRANSACTION_XA_ENABLED=false
181191
volumes:
182192
- ./realm-export.json:/opt/keycloak/data/import/realm-export.json
183-
command: ["start-dev", "--import-realm"]
193+
command: [ "start-dev", "--import-realm" ]
184194
healthcheck:
185-
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
195+
test: [ "CMD", "curl", "-f", "http://localhost:8080/health" ]
186196
interval: 30s
187197
timeout: 10s
188198
retries: 10
@@ -192,60 +202,6 @@ services:
192202
condition: service_healthy
193203
restart: always
194204

195-
keycloak-proxy:
196-
image: nginx:latest
197-
ports:
198-
- "8090:8090" # HTTP port
199-
- "8443:8443" # HTTPS port
200-
volumes:
201-
- ./nginx/keycloak.conf:/etc/nginx/nginx.conf:ro
202-
- ./certs:/etc/nginx/certs:ro
203-
restart: always
204-
profiles:
205-
- proxy
206-
207-
web-proxy:
208-
image: nginx:latest
209-
ports:
210-
- "80:80" # HTTP port
211-
- "443:443" # HTTPS port
212-
volumes:
213-
- ./nginx/web.conf:/etc/nginx/nginx.conf:ro
214-
- ./certs:/etc/nginx/certs:ro
215-
depends_on:
216-
- web
217-
restart: always
218-
profiles:
219-
- proxy
220-
221-
server-proxy:
222-
image: nginx:latest
223-
ports:
224-
- "8010:8010" # HTTP port
225-
- "8444:8444" # HTTPS port
226-
volumes:
227-
- ./nginx/server.conf:/etc/nginx/nginx.conf:ro
228-
- ./certs:/etc/nginx/certs:ro
229-
depends_on:
230-
- server
231-
restart: always
232-
profiles:
233-
- proxy
234-
235-
minio-proxy:
236-
image: nginx:latest
237-
ports:
238-
- "9100:9100" # MinIO API
239-
- "9101:9101" # MinIO Console
240-
volumes:
241-
- ./nginx/minio.conf:/etc/nginx/nginx.conf:ro
242-
- ./certs:/etc/nginx/certs:ro
243-
depends_on:
244-
- minio
245-
restart: always
246-
profiles:
247-
- proxy
248-
249205
volumes:
250206
postgres_data:
251207
redis_data:

0 commit comments

Comments
 (0)