generated from The-Swarm-Corporation/Swarms-Example-1-Click-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
110 lines (103 loc) · 2.05 KB
/
docker-compose.yml
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
# 1. Create required directories:
# ```bash
# mkdir -p data logs
# chmod 770 data logs
# ```
# 2. Start the services:
# ```bash
# docker compose up -d
# ```
# 3. View logs:
# ```bash
# docker compose logs -f
# ```
# 4. Stop services:
# ```bash
# docker compose down
# ```
version: '3.9'
services:
agent-api:
build:
context: .
dockerfile: Dockerfile
args:
- AGENT_UID=10001
- AGENT_GID=10001
image: agent-api:latest
container_name: agent-api
restart: unless-stopped
environment:
- WORKSPACE_DIR=agent_workspace
- WORKERS=4
- TIMEOUT=120
- LOG_LEVEL=warning
- MAX_REQUESTS=10000
ports:
- "8000:8000"
volumes:
- type: volume
source: agent_data
target: /agent_workspace/data
- type: volume
source: agent_logs
target: /agent_workspace/logs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 30s
retries: 3
start_period: 5s
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '1'
memory: 1G
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- agent_network
networks:
agent_network:
name: agent_network
driver: bridge
internal: true
driver_opts:
com.docker.network.bridge.name: br-agent
ipam:
driver: default
config:
- subnet: 172.28.0.0/16
ip_range: 172.28.5.0/24
gateway: 172.28.5.1
volumes:
agent_data:
name: agent_data
driver: local
driver_opts:
type: none
device: ${PWD}/data
o: bind
agent_logs:
name: agent_logs
driver: local
driver_opts:
type: none
device: ${PWD}/logs
o: bind