Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
96 lines (93 loc) · 2.25 KB
/
Copy pathdocker-compose.yml
File metadata and controls
96 lines (93 loc) · 2.25 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
services:
# Migas API server
migas-server:
build:
context: .
image: "migas-server:latest"
container_name: "migas-server"
ports:
- "8081:8080"
depends_on:
database:
condition: service_healthy
hotmem:
condition: service_healthy
networks:
- migas
command:
--proxy-headers --port 8080 --host 0.0.0.0 --reload --reload-dir /src
volumes:
- .:/src
- /src/.venv/
develop:
watch:
- action: sync
path: .
target: /src/
ignore:
- .venv/
- .git/
- .maint/
- .pytest_cache/
- .ruff_cache/
- __pycache__/
- dump.rdb
- mounts/
- action: rebuild
path: ./uv.lock
- action: rebuild
path: ./pyproject.toml
- action: rebuild
path: ./Dockerfile
environment:
MIGAS_REDIS_URI: "redis://hotmem:6379"
DATABASE_URL: "postgresql+asyncpg://postgres:crumbs@postgres:5432/migas"
MIGAS_REQUEST_WINDOW:
MIGAS_MAX_REQUESTS_PER_WINDOW:
MIGAS_MAX_REQUEST_SIZE:
MIGAS_BYPASS_RATE_LIMIT:
MIGAS_GEOLOC:
MIGAS_DEV: 1
PYTEST_ADDOPTS: "-p no:cacheprovider"
# Redis in-memory db
hotmem:
image: "redis:7.0.2-alpine3.16"
container_name: "redis"
hostname: "redis"
restart: always
ports:
- "6380:6379"
networks:
- migas
command: redis-server
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 10s
timeout: 10s
retries: 1
# Postgres persistent db
database:
image: "postgres:14.3-alpine3.16"
container_name: "postgres"
hostname: "postgres"
restart: always
ports:
- "5433:5432"
volumes:
- ${MIGAS_POSTGRES_DATA_DIR:-./mounts/db}:/var/lib/postgresql/data/
- ./deploy/docker/init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "crumbs"
POSTGRES_DB: "migas"
networks:
- migas
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -h postgres"]
interval: 10s
timeout: 10s
retries: 2
# Network to link all services
networks:
migas:
name: migas