-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
112 lines (107 loc) · 3.13 KB
/
Copy pathcompose.yml
File metadata and controls
112 lines (107 loc) · 3.13 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
services:
# Vue 3 App (with Vite)
vue-app:
build:
context: ./frontend/vue
ports:
- "5173:5173" # Vite dev server port
volumes:
- ./frontend/vue:/app # Mount your code with performance optimization
- vue_node_modules:/app/node_modules # Prevent node_modules from being overwritten
working_dir: /app
command: ["npm", "run", "dev"]
networks:
- speech-network
backend:
build:
context: ./backend
container_name: backend-core
command: >
sh -c "
if [ -n \"$$RESTORE_SNAPSHOT\" ]; then
echo 'Auto-restoring snapshot: '$$RESTORE_SNAPSHOT &&
python scripts/restore.py $$RESTORE_SNAPSHOT --non-interactive
fi &&
python -m alembic upgrade head &&
uvicorn src.main:app --host ${UVICORN_HOST} --port ${UVICORN_PORT} --reload
"
healthcheck:
test: ["CMD", "curl", "-f", "http://${UVICORN_HOST}:${UVICORN_PORT}/api/v1/"]
interval: 30s
timeout: 5s
retries: 5
start_period: 1s
depends_on:
postgres_timescale_pg_vector:
condition: service_healthy
ports:
- "${UVICORN_PORT}:8000"
env_file:
- .env
environment:
- DATABASE_URL=${DATABASE_URL?Variable not set}
- PYTHONPATH=/app/src
- RESTORE_SNAPSHOT=${RESTORE_SNAPSHOT:-}
volumes:
- ./backend/src:/app/src
- ./backend/scripts:/app/scripts
- ./backend/tests:/app/tests
- ./data/media:/app/media
- ./backups/snapshots:/app/backups/snapshots
#- ./backend/${MIGRATIONS_DIR?Variable not set}:/app/${MIGRATIONS_DIR}
- /etc/localtime:/etc/localtime:ro
- model_data:${MODEL_DIR?Variable not set}
- hf_cache:${HF_CACHE_DIR?Variable not set}
networks:
- speech-network
- backend-net
postgres_timescale_pg_vector:
#container_name: postgres_sql
build:
context: ./postgres
ports:
- "${POSTGRES_PORT}:5432" # PostgresSQL exposed to host on 5433
volumes:
- pg_speech:/var/lib/postgresql/data
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
environment:
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- POSTGRES_DB=${POSTGRES_DB?Variable not set}
networks:
- speech-network
- backend-net
# pgAdmin for managing PostgresSQL
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin4_database_tool
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL?Variable not set}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD?Variable not set}
ports:
- "5050:80" # Access pgAdmin
depends_on:
- postgres_timescale_pg_vector
volumes:
- pgadmin_data:/var/lib/pgadmin
networks:
- speech-network
volumes:
web_app:
vue_node_modules:
pgadmin_data:
pg_speech:
hf_cache:
model_data:
networks:
speech-network:
driver: bridge
backend-net:
driver: bridge