mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-09-04 02:46:23 +00:00
converting projects to portainer ready
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
# Portainer
|
||||
|
||||
## Ports
|
||||
|
||||
Portainer: 9000
|
||||
Portainer Agent: 9001
|
||||
|
||||
## Network
|
||||
|
||||
Create a private network for portainer: ```sudo podman network create portainer-net```
|
||||
|
||||
## env config
|
||||
|
||||
You must set an agent secret ```openssl rand -base64 32```
|
||||
|
||||
```
|
||||
# Portainer
|
||||
PORTAINER_IMAGE=portainer/portainer-ce:latest
|
||||
PORTAINER_AGENT_IMAGE=portainer/agent:latest
|
||||
AGENT_SECRET=01234567890132456789012345678912 #HELP: gen32
|
||||
VOL_PATH=/docker/vol/portainer-data #HELP: volpath
|
||||
COOKBOOK=/home/user/git/docker-compose-cookbooks #HELP: cookbooks
|
||||
```
|
||||
|
||||
### Docker Compose Extend
|
||||
|
||||
Now using extend you can call the service:
|
||||
|
||||
```yaml
|
||||
version: '3.4'
|
||||
|
||||
networks:
|
||||
portainer-net:
|
||||
external: true
|
||||
|
||||
services:
|
||||
portainer-agent:
|
||||
extends:
|
||||
file: ${COOKBOOK}/portainer/docker-compose.yml
|
||||
service: portainer-agent
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
portainer:
|
||||
extends:
|
||||
file: ${COOKBOOK}/portainer/docker-compose.yml
|
||||
service: portainer
|
||||
env_file:
|
||||
- .env
|
||||
```
|
||||
|
||||
You will likely want to spit up the agent and GUI in your projects.
|
||||
|
||||
## Gotchas
|
||||
|
||||
### Podman
|
||||
|
||||
Make sure podman-docker is installed.
|
||||
```sudo dnf install podman-docker```
|
||||
|
||||
Create the necessary directory for Podman
|
||||
```bash
|
||||
sudo mkdir -p /run/podman
|
||||
sudo chmod 755 /run/podman
|
||||
# Restart Podman socket service
|
||||
sudo systemctl restart podman.socket
|
||||
# Check the status of the Podman socket
|
||||
sudo systemctl status podman.socket
|
||||
```
|
||||
Reference in New Issue
Block a user