-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
146 lines (140 loc) · 3.31 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
146 lines (140 loc) · 3.31 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
134
135
136
137
138
139
140
141
142
143
144
145
146
services:
app:
build: .
image: ghcr.io/m0wer/mercaapi:master
command: python -m fastapi run --reload --port 80
ports:
- "8000:80"
volumes:
- ./app:/app/app
- ./mercadona.db:/app/mercadona.db
- ./main.py:/app/main.py
- ./alembic.ini:/app/alembic.ini
environment:
- PYTHONPATH=/app
- AI_BASE_URL=${AI_BASE_URL}
- AI_API_KEY=${AI_API_KEY}
- AI_MODEL=${AI_MODEL:-gpt-5.4-mini}
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
depends_on:
- redis
- worker-high
- worker-low
user: '1000:1000'
deploy:
resources:
limits:
cpus: '2'
memory: 512M
restart: always
tests:
build: .
image: ghcr.io/m0wer/mercaapi:master
command: sh -c exit
volumes:
- .:/app
environment:
- PYTHONPATH=/app
- AI_BASE_URL=${AI_BASE_URL}
- AI_API_KEY=${AI_API_KEY}
- AI_MODEL=${AI_MODEL:-gpt-5.4-mini}
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
depends_on:
- redis
user: '1000:1000'
deploy:
resources:
limits:
cpus: '1'
memory: 256M
updater:
build: .
image: ghcr.io/m0wer/mercaapi:master
command: sh -c "python -m alembic upgrade head && python cli.py update"
profiles:
- update
volumes:
- ./mercadona.db:/app/mercadona.db
environment:
- PYTHONPATH=/app
- AI_BASE_URL=${AI_BASE_URL}
- AI_API_KEY=${AI_API_KEY}
- AI_MODEL=${AI_MODEL:-gpt-5.4-mini}
user: '1000:1000'
deploy:
resources:
limits:
cpus: '2'
memory: 512M
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- ./redis:/data
user: '1000:1000'
deploy:
resources:
limits:
cpus: '1'
memory: 1G
restart: always
worker-high:
build: .
command: python -m celery -A app.worker worker -Q high -c 8 -l DEBUG
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- PYTHONPATH=/app
- PRELOAD_PRODUCTS=1
volumes:
- ./app:/app/app
- ./mercadona.db:/app/mercadona.db
depends_on:
- redis
user: '1000:1000'
deploy:
resources:
limits:
cpus: '8'
memory: 2G
restart: always
worker-low:
build: .
command: python -m celery -A app.worker worker -Q low -c 1 -l DEBUG
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- PYTHONPATH=/app
volumes:
- ./app:/app/app
- ./mercadona.db:/app/mercadona.db
depends_on:
- redis
user: '1000:1000'
deploy:
resources:
limits:
cpus: '1'
memory: 300M
restart: always
flower:
image: mher/flower
command: python -m celery flower --broker=redis://redis:6379/0 --port=5555
ports:
- "5555:5555"
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
depends_on:
- redis
- worker-high
user: '1000:1000'
deploy:
resources:
limits:
cpus: "1"
memory: 256M
restart: always