From 5cfa856a07e6853dbf0754bf777e9d84e3f79bd1 Mon Sep 17 00:00:00 2001 From: Leon Stoldt Date: Sat, 7 Aug 2021 14:37:23 +0200 Subject: [PATCH] Adding portainer example Signed-off-by: Leon Stoldt --- README.md | 1 + portainer/README.md | 56 +++++++++++++++++++++++++++++++++++ portainer/docker-compose.yaml | 15 ++++++++++ 3 files changed, 72 insertions(+) create mode 100644 portainer/README.md create mode 100644 portainer/docker-compose.yaml diff --git a/README.md b/README.md index 4275f17..a5f4d45 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ with Spring framework and a Postgres database. - [`Django`](https://github.com/docker/awesome-compose/tree/master/django) - [`Minecraft server`](https://github.com/docker/awesome-compose/tree/master/minecraft) - [`Plex`](https://github.com/docker/awesome-compose/tree/master/plex) +- [`Portainer`](https://github.com/docker/awesome-compose/tree/master/portainer) ## Basic setups for different platforms (not production ready - useful for personal use) - [`Gitea / PostgreSQL`](https://github.com/docker/awesome-compose/tree/master/gitea-postgres) - [`Nextcloud / PostgreSQL`](https://github.com/docker/awesome-compose/tree/master/nextcloud-postgres) diff --git a/portainer/README.md b/portainer/README.md new file mode 100644 index 0000000..6c2e948 --- /dev/null +++ b/portainer/README.md @@ -0,0 +1,56 @@ +## Portainer (CE) +This example provides a base setup for using [Portainer](https://www.portainer.io/). +More details on how to customize the installation and the compose file can be found in [portainer documentation](https://documentation.portainer.io/). + +### Demo +You can try out the public demo instance first: http://demo.portainer.io/ +- username: admin +- password: tryportainer + +Project structure: +``` +. +├── docker-compose.yaml +└── README.md +``` + +[_docker-compose.yaml_](docker-compose.yaml) +``` yaml +services: + portainer: + image: portainer/portainer-ce:alpine +``` + +## Deploy with docker-compose +When deploying this setup, the web interface will be available on port 9000 (e.g. http://localhost:9000). + +``` shell +$ docker-compose up -d +Starting portainer ... done +``` + + +## Expected result + +Check containers are running: +``` +$ docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +860311c00e62 portainer/portainer-ce:alpine "/portainer -H unix:…" 54 seconds ago Up 53 seconds 8000/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp portainer + +``` + +Navigate to `http://localhost:9000` in your web browser to access the portainer web interface and create an account. + + +Stop the containers with +``` shell +$ docker-compose down +# To delete all data run: +$ docker-compose down -v +``` + +## Troubleshooting +- Select the correct image for your OS. You can take a look at the published tags at [DockerHub](https://hub.docker.com/r/portainer/portainer-ce/tags) + +> e.g. currently, the latest tag is for Windows (amd64) and alpine for Linux (amd64, arm/v7) \ No newline at end of file diff --git a/portainer/docker-compose.yaml b/portainer/docker-compose.yaml new file mode 100644 index 0000000..56c3e6b --- /dev/null +++ b/portainer/docker-compose.yaml @@ -0,0 +1,15 @@ +version: '3.7' +services: + portainer: + image: portainer/portainer-ce:alpine + container_name: portainer + command: -H unix:///var/run/docker.sock + ports: + - "9000:9000" + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + - "portainer_data:/data" + restart: always + +volumes: + portainer_data: \ No newline at end of file