-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
37 lines (33 loc) · 1.09 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
version: '3.9'
services:
# Agent service configuration
agent:
# Use the portainer/agent Docker image
image: portainer/agent
volumes:
# Mount the host's Docker socket into the container
- /var/run/docker.sock:/var/run/docker.sock
# Mount the host's Docker volumes into the container
- /var/lib/docker/volumes:/var/lib/docker/volumes
restart: unless-stopped
# Portainer service configuration
portainer:
# Use the portainer/portainer-ce Docker image
image: portainer/portainer-ce
# Specify the command for the container
command: -H tcp://agent:9001 --tlsskipverify
# Publish the container's port 9000 to the host's port 9000
ports:
- "9000:9000"
volumes:
# Mount the host's Docker socket into the container
- /var/run/docker.sock:/var/run/docker.sock
# Create a named volume for persistent Portainer data storage
- portainer_data:/data
# Wait for the agent service to be ready
depends_on:
- agent
restart: unless-stopped
volumes:
# Volume for Portainer data persistence
portainer_data: