Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (56 loc) · 1.47 KB
/
Copy pathdocker-compose.yml
File metadata and controls
60 lines (56 loc) · 1.47 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
services:
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
ports:
- "80:80"
depends_on:
- app
restart: always
app:
build: .
ports:
- "5000:5000"
environment:
- APP_ENV=production
- DATABASE_URL=postgresql://${POSTGRES_USER:-bibliouser}:${POSTGRES_PASSWORD:-bibliopass}@db:5432/${POSTGRES_DB:-bibliodb}
- REDIS_URL=redis://redis:6379/0
- CACHE_TYPE=redis
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-super-secret-production-key-change-this}
- FLASK_DEBUG=False
- FLASK_HOST=0.0.0.0
- PORT=5000
- REDIS_MAXMEMORY=512mb
- REDIS_EVICTION_POLICY=allkeys-lru
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
volumes:
- .:/app
restart: always
db:
image: postgres:15-alpine
environment:
- POSTGRES_USER=${POSTGRES_USER:-bibliouser}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-bibliopass}
- POSTGRES_DB=${POSTGRES_DB:-bibliodb}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-bibliouser} -d ${POSTGRES_DB:-bibliodb}"]
interval: 5s
timeout: 5s
retries: 5
restart: always
redis:
image: redis:7-alpine
command: redis-server --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
restart: always
volumes:
postgres_data:
redis_data: