-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
183 lines (178 loc) · 4.87 KB
/
docker-compose.yml
File metadata and controls
183 lines (178 loc) · 4.87 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
services:
postgres:
image: pgvector/pgvector:pg17
container_name: vector-cv-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "${DOCKER_POSTGRES_PORT:-5453}:5432"
networks:
- vector-cv-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
backend:
image: ${IMAGE_NAME}:${IMAGE_TAG:-production}
container_name: vector-cv-backend
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
# Auth Credentials
AUTH_USERNAME: ${AUTH_USERNAME}
AUTH_PASSWORD: ${AUTH_PASSWORD}
AUTH_NAME: ${AUTH_NAME}
AUTH_EMAIL: ${AUTH_EMAIL}
# Cookie settings
COOKIE_NAME: ${COOKIE_NAME}
COOKIE_KEY: ${COOKIE_KEY}
# Database - CRITICAL: Must use 'postgres' as hostname
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: ${DB_NAME}
# Ports
BACKEND_PORT: 8010
# API Configuration
# PROXY_ROOT_PATH: ${PROXY_ROOT_PATH}
# CORS
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS}
# Rate Limiting
ADMIN_API_KEY: ${ADMIN_API_KEY}
ENABLE_RATE_LIMITING: ${ENABLE_RATE_LIMITING:-true}
MAX_CV_PER_DAY: ${MAX_CV_PER_DAY:-3}
GENERAL_RATE_LIMIT: ${GENERAL_RATE_LIMIT:-60}
# OpenAI
OPENAI_API_KEY: ${OPENAI_API_KEY}
ports:
- "${DOCKER_BACKEND_PORT:-8200}:8010"
volumes:
- generated_docs:/app/generated_docs
- api_logs:/app/api_logs
networks:
- vector-cv-network
- proxy-network
command: uvicorn main:app --host 0.0.0.0 --port 8010
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
healthcheck:
# -f: fail on 4xx/5xx errors
# -s: silent mode
test: ["CMD", "curl", "-f", "http://127.0.0.1:8010/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
admin:
image: ${IMAGE_NAME}:${IMAGE_TAG:-production}
container_name: vector-cv-admin
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
environment:
# Auth Credentials
AUTH_USERNAME: ${AUTH_USERNAME}
AUTH_PASSWORD: ${AUTH_PASSWORD}
AUTH_NAME: ${AUTH_NAME}
AUTH_EMAIL: ${AUTH_EMAIL}
# Cookie settings
COOKIE_NAME: ${COOKIE_NAME}
COOKIE_KEY: ${COOKIE_KEY}
# Database - CRITICAL: Must use 'postgres' as hostname
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: ${DB_NAME}
# Backend URL (internal)
API_URL: "http://backend:8010"
BACKEND_URL: "http://backend:8010"
# Admin API Key
ADMIN_API_KEY: ${ADMIN_API_KEY}
# OpenAI
OPENAI_API_KEY: ${OPENAI_API_KEY}
ports:
- "${DOCKER_ADMIN_PORT:-8210}:8501"
volumes:
- generated_docs:/app/generated_docs
networks:
- vector-cv-network
- proxy-network
command: >
streamlit run streamlit_app.py
--server.port=8501
--server.address=0.0.0.0
--server.baseUrlPath=/admin
--server.enableCORS=false
--server.enableXsrfProtection=false
--browser.gatherUsageStats=false
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
healthcheck:
# Streamlit runs on 8501. We check the root /admin path as configured in your command
test: ["CMD", "curl", "-f", "http://127.0.0.1:8501/admin"]
interval: 30s
timeout: 10s
retries: 3
frontend:
image: ${IMAGE_NAME}:${IMAGE_TAG:-production}
container_name: vector-cv-frontend
restart: unless-stopped
command: ["nginx", "-g", "daemon off;"]
depends_on:
backend:
condition: service_healthy
environment:
# Virtual Host for nginx-proxy
VIRTUAL_HOST: ${VIRTUAL_HOST}
VIRTUAL_PORT: 80
LETSENCRYPT_HOST: ${VIRTUAL_HOST}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
NGINX_PROXY_READ_TIMEOUT: "300"
NGINX_PROXY_CONNECT_TIMEOUT: "300"
NGINX_PROXY_SEND_TIMEOUT: "300"
ports:
- "${DOCKER_FRONTEND_PORT:-8220}:80"
networks:
- vector-cv-network
- proxy-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:80/"]
interval: 30s
timeout: 10s
retries: 3
volumes:
postgres_data:
generated_docs:
api_logs:
networks:
vector-cv-network:
driver: bridge
proxy-network:
external: true