forked from senko/cijene-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.worker.yml
More file actions
74 lines (69 loc) · 2.26 KB
/
docker-compose.worker.yml
File metadata and controls
74 lines (69 loc) · 2.26 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
services:
api:
container_name: worker-api
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
env_file:
- ./.env
environment:
REDIRECT_URL: http://localhost:8000/docs
PYTHONUTF8: "1"
volumes:
- ./.env:/app/.env
- ./crawler_output:/app/crawler_output # Mount crawler output for direct access
- .:/app # Mount the entire project directory
command: [ "sh", "-c", "python -m uvicorn service.main:app --host 0.0.0.0 --port 8000 --reload" ] # Add --reload for development
crawler:
container_name: worker-crawler
build:
context: .
dockerfile: Dockerfile
env_file:
- ./.env
environment:
# --- THESE ARE THE CRUCIAL LINES TO ADD/ENSURE ---
- LANG=C.UTF-8
- LC_ALL=C.UTF-8
# It's good practice to keep these as well
- PYTHONUNBUFFERED=1 # Ensures logs appear in real-time
- PYTHONUTF8=1
# Your existing variables
- API_KEY=${API_KEY}
- BASE_URL=${BASE_URL}
volumes:
- ./crawler_output:/app/output # Mount crawler output for direct access
- .:/app # Mount the entire project directory
command: [ "tail", "-f", "/dev/null" ]
networks:
# Add networks section
- monitoring-network # Connect to the existing monitoring-network
alloy:
container_name: worker-alloy
# THIS IS THE CRITICAL LINE THAT MUST BE CORRECT
image: grafana/alloy:v1.1.0
restart: unless-stopped
volumes:
# Mount the Docker socket as read-only for better security
- /var/run/docker.sock:/var/run/docker.sock:ro
# Your config file needs access to the host log paths. Mount as read-only.
- /var/lib/docker/containers:/var/lib/docker/containers:ro
# Your Alloy config file
- ./config/alloy/alloy-config.alloy:/etc/alloy/config.alloy
# A persistent volume for Alloy's data (like log positions)
- alloy_data:/data
command:
- "run"
- "/etc/alloy/config.alloy"
# This flag tells Alloy where to store its data inside the container
- "--storage.path=/data"
networks:
# Add networks section
- monitoring-network # Connect to the existing monitoring-network
volumes:
alloy_data:
networks:
monitoring-network:
driver: bridge