Skip to content

Commit 408264a

Browse files
committed
some updates to docker setup
1 parent a6f747c commit 408264a

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

docker-compose.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
version: "3.9"
22

33
services:
4+
redis:
5+
image: redis:7-alpine
6+
container_name: redis
7+
ports:
8+
- "6379:6379"
9+
volumes:
10+
- redis_data:/data
11+
restart: unless-stopped
12+
413
rabbitmq:
514
image: rabbitmq:3-management
615
container_name: rabbitmq
@@ -12,9 +21,15 @@ services:
1221
environment:
1322
RABBITMQ_DEFAULT_USER: guest
1423
RABBITMQ_DEFAULT_PASS: guest
24+
restart: unless-stopped
25+
healthcheck:
26+
test: ["CMD", "rabbitmq-diagnostics", "ping"]
27+
interval: 30s
28+
timeout: 10s
29+
retries: 5
1530

1631
ollama:
17-
image: ollama/ollama
32+
image: ollama/ollama:latest
1833
container_name: ollama
1934
ports:
2035
- "11434:11434"
@@ -31,12 +46,16 @@ services:
3146
dockerfile: docker/api_server.dockerfile
3247
container_name: api_server
3348
depends_on:
34-
- rabbitmq
49+
rabbitmq:
50+
condition: service_healthy
51+
redis:
52+
condition: service_started
3553
ports:
3654
- "8000:8000"
3755
environment:
38-
# Add your environment variables or load from `.env`
39-
RABBITMQ_URL: amqp://guest:guest@rabbitmq//
56+
- REDIS_URL=redis://redis:6379/0
57+
- RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/
58+
- OLLAMA_URL=http://ollama:11434
4059
volumes:
4160
- .:/app
4261
command: ["poetry", "run", "python", "run_api.py"]
@@ -47,13 +66,20 @@ services:
4766
dockerfile: docker/worker.dockerfile
4867
container_name: worker
4968
depends_on:
50-
- rabbitmq
69+
rabbitmq:
70+
condition: service_healthy
71+
redis:
72+
condition: service_started
5173
environment:
52-
RABBITMQ_URL: amqp://guest:guest@rabbitmq//
74+
- REDIS_URL=redis://redis:6379/0
75+
- RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/
76+
- OLLAMA_URL=http://ollama:11434
5377
volumes:
5478
- .:/app
5579
command: ["poetry", "run", "dramatiq", "mxtoai.tasks", "--watch", "./."]
5680

5781
volumes:
5882
rabbitmq_data:
5983
ollama_data:
84+
redis_data:
85+

docker/worker.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ FROM python:3.13-slim-bookworm
66
RUN apt-get update && apt-get install -y --no-install-recommends \
77
curl \
88
build-essential \
9+
ffmpeg \
910
&& rm -rf /var/lib/apt/lists/*
1011

1112
# Set workdir

0 commit comments

Comments
 (0)