-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
133 lines (128 loc) · 3.67 KB
/
docker-compose.yml
File metadata and controls
133 lines (128 loc) · 3.67 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
services:
db:
image: postgres:16-alpine
container_name: folio-db
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER:-folio}
POSTGRES_PASSWORD: ${DB_PASSWORD:-folio_dev_password}
POSTGRES_DB: ${DB_NAME:-folio}
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-folio}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- folio-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
cache:
image: valkey/valkey:9.0.4
container_name: folio-cache
restart: unless-stopped
command: redis-server --save 60 1 --loglevel warning
volumes:
- folio_cache_data:/var/lib/redis/data
networks:
- folio-network
expose:
- "6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
api:
build:
context: .
dockerfile: api/Dockerfile
cache_from:
- folio-api:latest
image: folio-api:latest
container_name: folio-api
restart: unless-stopped
env_file: ./api/.env
environment:
# Override for Docker networking
DATABASE_URL: postgresql+asyncpg://${DB_USER:-folio}:${DB_PASSWORD:-folio_dev_password}@db:5432/${DB_NAME:-folio}
REDIS_URL: redis://cache:6379/0
ports:
- "${API_PORT:-8000}:8000"
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
volumes:
- ./api:/app
command: >
python -m uvicorn main:app
--host ${API_HOST:-0.0.0.0}
--port ${API_PORT:-8000}
--reload
networks:
- folio-network
healthcheck:
test:
[
"CMD",
"/opt/python/bin/python",
"-c",
"import urllib.request; r=urllib.request.urlopen('http://localhost:8000/health', timeout=5); exit(0 if r.status==200 else 1)",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
web:
build:
context: .
dockerfile: web/docker/Dockerfile.dev
cache_from:
- folio-web:latest
image: folio-web:latest
container_name: folio-web
restart: unless-stopped
env_file: ./web/.env.local
ports:
- "${WEB_PORT:-3000}:3000"
depends_on:
api:
condition: service_healthy
volumes:
- ./web:/app
- /app/node_modules
command: npm run dev
networks:
- folio-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
postgres_data:
driver: local
folio_cache_data:
driver: local
networks:
folio-network:
name: folio-network
driver: bridge
ipam:
config:
- subnet: 172.24.0.0/16