-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (50 loc) · 1.29 KB
/
Copy pathdocker-compose.yml
File metadata and controls
52 lines (50 loc) · 1.29 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
services:
redis:
image: redis:7-alpine
container_name: redis
restart: unless-stopped
volumes:
- redis-data:/data
docker-api:
build:
context: .
dockerfile: Dockerfile
container_name: docker-api
image: docker-api:latest
ports:
- "8080:8080"
volumes:
# Mount the Docker daemon socket so the API can manage containers on the host.
- /var/run/docker.sock:/var/run/docker.sock
# Run as root so the container can access the Docker socket without matching the host docker group GID.
# For nonroot, use the image's default user and set DOCKER_GID to your host's docker group GID.
user: "0:0"
environment:
- PORT=8080
- REDIS_ADDR=redis:6379
- AGENT_SERVER_URL=${AGENT_SERVER_URL:-}
depends_on:
- redis
restart: unless-stopped
healthcheck:
test: ["CMD", "/docker-api", "--healthcheck"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# Constrain resource usage in production.
deploy:
resources:
limits:
cpus: "0.50"
memory: 128M
reservations:
cpus: "0.05"
memory: 32M
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
redis-data: