-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdokploy.yaml
More file actions
135 lines (129 loc) · 3.48 KB
/
Copy pathdokploy.yaml
File metadata and controls
135 lines (129 loc) · 3.48 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
132
133
134
135
services:
backend:
build:
context: ./src/backend
dockerfile: Dockerfile.server
ports:
- 8000
- 80
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- NEO4J_URI=bolt://db:7687
- NEO4J_USERNAME=${NEO4J_USERNAME}
- NEO4J_PASSWORD=${NEO4J_PASSWORD}
- LLM_API_KEY=${LLM_API_KEY}
- LLM_PROVIDER=${LLM_PROVIDER:-openai}
- ENVIRONMENT=production
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS}
- SERVER_IP=${SERVER_IP}
- PRODUCTION_DOMAIN=${PRODUCTION_DOMAIN}
- SECRET_KEY=${SECRET_KEY}
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
- B2_BUCKET_URL=${B2_BUCKET_URL}
- B2_ACCESS_KEY=${B2_ACCESS_KEY}
- B2_SECRET_KEY=${B2_SECRET_KEY}
- B2_BUCKET_NAME=${B2_BUCKET_NAME}
- CELERY_TASK_TIME_LIMIT=${CELERY_TASK_TIME_LIMIT}
- CELERY_TASK_SOFT_TIME_LIMIT=${CELERY_TASK_SOFT_TIME_LIMIT}
depends_on:
- db
- redis
restart: unless-stopped
networks:
- app-network
deploy:
resources:
limits:
memory: 1G
cpus: '1.0'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
worker:
build:
context: ./src/backend
dockerfile: Dockerfile.worker
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- NEO4J_URI=bolt://db:7687
- NEO4J_USERNAME=${NEO4J_USERNAME}
- NEO4J_PASSWORD=${NEO4J_PASSWORD}
- LLM_API_KEY=${LLM_API_KEY}
- LLM_PROVIDER=${LLM_PROVIDER:-openai}
- CELERY_TASK_TIME_LIMIT=${CELERY_TASK_TIME_LIMIT}
- CELERY_TASK_SOFT_TIME_LIMIT=${CELERY_TASK_SOFT_TIME_LIMIT}
depends_on:
- db
- redis
restart: unless-stopped
networks:
- app-network
deploy:
replicas: 1
resources:
limits:
memory: 2G
cpus: '2.0'
healthcheck:
test: ["CMD", "celery", "-A", "src.worker", "inspect", "ping"]
interval: 30s
timeout: 10s
retries: 3
db:
image: neo4j:5.15.0
environment:
- NEO4J_AUTH=${NEO4J_USERNAME}/${NEO4J_PASSWORD}
- NEO4J_PLUGINS=["apoc"]
- NEO4J_dbms_memory_heap_initial__size=512m
- NEO4J_dbms_memory_heap_max__size=2G
- NEO4J_dbms_memory_pagecache_size=1G
- NEO4J_dbms_security_procedures_unrestricted=apoc.*
- NEO4J_dbms_security_procedures_allowlist=apoc.*
volumes:
- neo4j_data:/data
- neo4j_logs:/logs
- neo4j_import:/var/lib/neo4j/import
- neo4j_plugins:/plugins
restart: unless-stopped
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "cypher-shell -u ${NEO4J_USERNAME} -p ${NEO4J_PASSWORD} 'RETURN 1'"]
interval: 10s
timeout: 10s
retries: 10
start_period: 30s
redis:
image: redis:7-alpine
restart: unless-stopped
networks:
- app-network
volumes:
- redis_data:/data
- ./redis.conf:/usr/local/etc/redis/redis.conf:ro
command: redis-server /usr/local/etc/redis/redis.conf
sysctls:
- net.core.somaxconn=65535
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 256M
cpus: '0.5'
volumes:
neo4j_data:
neo4j_logs:
neo4j_import:
neo4j_plugins:
redis_data:
networks:
app-network:
driver: bridge