-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (70 loc) · 2.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
74 lines (70 loc) · 2.17 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
# Dev stack — hot reload, runs entirely on your Mac.
# Frontend (Vite) serves HTTPS via mkcert certs in ./frontend/certs and
# proxies /api + /ws to the backend, so the browser sees a single secure origin
# (required for Web Crypto + service workers, even when testing from your phone
# over the Mac's LAN IP).
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-kryptovox}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-kryptovox}
POSTGRES_DB: ${POSTGRES_DB:-kryptovox}
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-kryptovox}"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
backend:
build:
context: ./backend
command: >
sh -c "alembic upgrade head &&
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload"
environment:
ENVIRONMENT: development
DATABASE_URL: ${DATABASE_URL:-postgresql+asyncpg://kryptovox:kryptovox@postgres:5432/kryptovox}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
SECRET_KEY: ${SECRET_KEY:-dev-secret-change-me-0000000000000000000000000000000000000000000000000000}
ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES:-15}
REFRESH_TOKEN_EXPIRE_DAYS: ${REFRESH_TOKEN_EXPIRE_DAYS:-90}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-https://localhost:5173}
volumes:
- ./backend:/app
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
frontend:
build:
context: ./frontend
command: npm run dev -- --host 0.0.0.0
environment:
# Same-origin: frontend proxies /api and /ws to backend, so no absolute URLs needed.
VITE_DEV_HTTPS: "true"
VITE_PROXY_TARGET: "http://backend:8000"
volumes:
- ./frontend:/app
- /app/node_modules
ports:
- "5173:5173"
depends_on:
- backend
volumes:
pgdata: