Portainer¶
docker compose files / stacks¶
Are all here
Use one .env file and Link to it¶
its very simple just do it like this
version: '3' # (1)!
env_file:
- /path/to/your/.env
services:
your_service:
image: your_image
environment:
- DB_PASSWORD=${DB_PASSWORD}
# other service configurations
it needs at least version 3
and then make your .env file look something like this:
Tip
Like this you can create one big .env file, save it somewhere accesible (in my case the folder where I keep all my docker stuff) and then you can link all your containers to it
Update Portainer Community Edition¶
Stop and remove your existing Portainer instance. This will not affect your other Docker containers.
Pull the latest Portainer-CE image.
Deploy the new Portainer container.
docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Warning
You may need to run these commands as root/sudo if you're not logged in as root.