Giter Site home page Giter Site logo

portainer-compose's Introduction

Portainer compose setup

A simple setup to deploy Portainer using docker-compose or docker stack deploy (Swarm).

Requirements

  1. Install Docker.
  2. (optional) Install Docker-compose.
  3. Clone this repository

Usage

Compose

See nginx-proxy/ or traefik/ for Compose deployments.

Swarm

Deploy this stack on a manager node inside your Swarm cluster:

docker stack deploy --compose-file=docker-stack.yml portainer

You can then access Portainer by using the IP address of any node in your Swarm cluster over port 9000 with a web browser.

portainer-compose's People

Contributors

deviantony avatar mvhconsult avatar natlibfi-arlehiko avatar xe-nvdk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

portainer-compose's Issues

templates not working

Thanks for the docker-compose file.

I have problems with the templates engine.

I could start with docker-compose but the portainer template section is empty.

The portainer-app logs are:

2017/01/27 19:18:00 Starting Portainer on :9000
2017/01/27 19:18:57 http error: Get http://templates/templates.json: dial tcp 127.0.53.53:80: getsockopt: connection refused (code=500)
2017/01/27 19:29:43 http error: Get http://templates/templates.json: dial tcp 127.0.53.53:80: getsockopt: connection refused (code=500)

docker-compose ps

        Name                      Command               State               Ports
---------------------------------------------------------------------------------------------
portainer-app          /portainer --templates htt ...   Up      9000/tcp
portainer-proxy        nginx -g daemon off;             Up      443/tcp, 0.0.0.0:80->80/tcp
portainer-templates    nginx -g daemon off;             Up      443/tcp, 0.0.0.0:8080->80/tcp
portainer-watchtower   /watchtower --cleanup port ...   Up

From Host machine:

curl localhost:8080/templates.json
[
  {
    "title": "RPI-Registry",
    "description": "Docker image registry",
    "logo": "https://cloudinovasi.id/assets/img/logos/registry.png",
...

A ping on from proxy to templates are working and an curl from proxy are the same result as above from localhost.

docker exec -it portainer-proxy /bin/sh
/ # curl
/bin/sh: curl: not found
/ # apk add curl
WARNING: Ignoring APKINDEX.167438ca.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.a2e6dac0.tar.gz: No such file or directory
ERROR: unsatisfiable constraints:
  curl (missing):
    required by: world[curl]
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
v3.4.6-60-gc61f5bf [http://dl-cdn.alpinelinux.org/alpine/v3.4/main]
v3.4.6-33-g38ef2d2 [http://dl-cdn.alpinelinux.org/alpine/v3.4/community]
OK: 5976 distinct packages available
/ # apk add curl
(1/4) Installing ca-certificates (20161130-r0)
(2/4) Installing libssh2 (1.7.0-r0)
(3/4) Installing libcurl (7.52.1-r0)
(4/4) Installing curl (7.52.1-r0)
Executing busybox-1.24.2-r12.trigger
Executing ca-certificates-20161130-r0.trigger
OK: 55 MiB in 28 packages
/ # curl http://templates/templates.json
[
  {
    "title": "RPI-Registry",
    "description": "Docker image registry",
...

Changing from port 80 to another

Hello, this works very well !
I would like to switch from port 80 to another port for the reverse proxy, is there an easy way to do this?
Changing the docker-compose exposed port and nginx listening port does not seem enough.

404 for Api only with Traefik compose

The following configuration will deploy, however the api calls are all 404. I'm not sure why this happens, maybe someone can offer me some insight?

Below is the portainer compose file.

version: '3'

networks:
  web:
    external: true
      
services:
  portainer:
    container_name: portainer
    image: portainer/portainer:latest
    restart: unless-stopped
    networks:
      - web
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - $HOME/Documents/services:/data
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.portainer.rule=Host(`portainer.gluaxspeed.xyz`)"
      - "traefik.http.routers.portainer.entrypoints=http"
      - "traefik.docker.network=web"

Below is traefik configurations.

version: '3'
  
networks:
  web:
    external: true

services:
  traefik:
    container_name: traefik
    image: traefik:v2.2
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    networks:
      - web
    volumes:
      - $HOME/Documents/services/traefik.yml:/traefik.yml
      - $HOME/Documents/services/dynamic_conf.yml:/dynamic_conf.yml
      - /var/run/docker.sock:/var/run/docker.sock
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.api.rule=Host(`monitor.gluaxspeed.xyz`)"

  whoami:
    image: containous/whoami
    container_name: whoami
    restart: unless-stopped
    networks:
      - web
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoami.rule=Host(`whoami.gluaxspeed.xyz`)"

Traefik.yml

log:
  level: INFO

entryPoints:
  http:
    address: :80

api:
  insecure: false
  debug: true
  dashboard: true

providers:
  docker:
    exposedByDefault: false
    network: web
  file:
    filename: dynamic_conf.yml
    watch: true

accessLog: {}

dynamic_conf.yml

http:
  routers:
    my-api:
      entryPoints:
        - http
      rule: "PathPrefix(`/dashboard`) || PathPrefix(`/api`)"
      service: api@internal
      middlewares:
        - dashboard-auth

  middlewares:
    dashboard-auth:
      basicAuth:
        users:
          - redacted

    https-redirect:
      redirectScheme:
        scheme: https

Stucked to: Connecting to the Docker endpoint...

Hey Tony!

I'm running a docker stack with Traefik, Wordpress, Nginx, Caddy, Whoami and Portainer.
For some reason Portainer don't want to launch ...

screen shot 2017-09-20 at 11 14 21 pm

Do you want to take a look? You'll see you can run the whole stack via one command via play-with-docker.

I would really like to have Portainer to be part of this Docker Stack boiler template.

Thanks in advance!
Pascal

[FEATURE] [BUG] We need a way to delete stack versions & OR Edit the paths

After manually deleting some versions of the docker-compose stacks now portainer and move the last version in folder for version 1, im left with portainer not able to access the docker-compose.yml.

I manually back the .ymls and .stack_envs remove the stack from portianer and remake them but this is a mess for multiple stacks.

I was thinking that by deleting them portianer will also "forget" them but it doesnt actually parse the directory to check the versions that exist, it stores the information in some kind of DB and search for the paths he takes form there.

We need either a way to scan the main directory or edit the paths our selfs. in the same logic we can also delete old versions..

I dont find any reason to keep 20 versions of the same stack without having a way to remove them.

Originally posted by @zzecool in portainer/portainer#10036 (comment)

Raspberry Pi compatibility

Dear @deviantony,

thanks for your great effort to create this project.

Currently I'm learning Docker onto my Raspberry Pi and want to manage my containers with Portainer and for the installation of Portainer I used your project files, but there are some errors while I try to initialize the containers.

As base docker operating system I'm using HypriotOS.

Is your project compatible with the Raspberry Pi?

Best regards

Way to define admin password via secrets/environment or something else

Hi! I would like to be able to do the deployment with the admin password already set.
I could not find using google how to do this.

For all other systems, it is easy to set an administrator password.

Asking for an administrator password the first time you log in is not secure.

404 not found after running docker-compose

Do I need to do any additional configuration before running docker-compose, or should I be able to just clone and run?

CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                         NAMES
968ce00d527a        centurylink/watchtower   "/watchtower --cle..."   2 minutes ago       Up 12 seconds                                     portainer-watchtower
348e571e2f04        portainer/portainer      "/portainer --temp..."   2 minutes ago       Up 12 seconds       9000/tcp                      portainer-app
4832846df683        portainercompose_proxy   "nginx -g 'daemon ..."   2 minutes ago       Up 11 seconds       0.0.0.0:80->80/tcp, 443/tcp   portainer-proxy
40388cb90c8d        portainer/templates      "nginx -g 'daemon ..."   2 minutes ago       Up 12 seconds       80/tcp, 443/tcp               portainer-templates

editing the docker-compose.yaml file to this makes it work. But I feel I'm missing out on something without those other containers running.

version: '2'

services:

  portainer:
    image: portainer/portainer
    container_name: "portainer-app"
    ports:
      - "9000:9000"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/portainer/data:/data

Update doc on new watchtower

Hey,
Detail.

You mention "deprecate centurylinks/watchtower, use v2tec/watchtower instead" but the readme.md still uses the link to centurylinks/watchtower.

Authentification conflict with the last version of portainer

Hello,

since the last release of portainer https://github.com/portainer/portainer/releases/tag/1.11.0, it intergrates a simple authentification mechanism. So the watchtower upgrades successfully my portainer but I had some conflicts between htpasswd and the simple authentification mechanism.

I decide to remove the .htpasswd, the linked conf and the COPY in order to only use the integrated auth from portainer.

I think it would be great if there are several branch or tags (1.0, 1.1 or 2.0) in order to take this into account.

I can make a PR at the end of the week if you want but it is pretty simple (just remove all code/file related to htpasswd).

Thanks in advance and keep going with your great work!

error : task: non-zero exit (1)

我使用docker stack deploy启动时会报错task: non-zero exit (1), 但是我使用docker run 的方式启动则不会有问题. 我的compose文件如下:
portainer:
image: portainer/portainer
ports:
- 9000:9000
volumes:
- /home/portainer/data:/data
networks:
- mynet
deploy:
placement:
constraints: [node.role==manager]

how to change the default ws port(8000) ?

I create a Docker Standalone Edag agent . like this:
image
image

looks like i have no way to change the default ws port , 8000 has already used by another service .
so i want change it to 18000 .
how should i do ?

Can't get HTTPS to work with Traefik (Bad Gateway)

Hi there,
I used the sample docker-compose.yml to get it to work with Traefik. Works great on port 80, but I need it on port 443, obviously because of security reasons.

How to achieve this?

I use the following but it does not work. I get a 502 Bad Gateway.

version: "2"

services:
  portainer:
    image: portainer/portainer
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data
    networks:
      - proxy
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.portainer.entrypoints=http"
      - "traefik.http.routers.portainer.rule=Host(`example.com`)"
      - "traefik.http.middlewares.portainer-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.portainer.middlewares=portainer-https-redirect"
      - "traefik.http.routers.portainer-secure.entrypoints=https"
      - "traefik.http.routers.portainer-secure.rule=Host(`example.com`)"
      - "traefik.http.routers.portainer-secure.tls=true"
      - "traefik.http.routers.portainer-secure.tls.certresolver=http"
      - "traefik.http.routers.portainer-secure.service=portainer"
      - "traefik.http.services.portainer.loadbalancer.server.port=80"
      - "traefik.docker.network=proxy"
      - "traefik.port=9000"

volumes:
  portainer_data:
networks:
  proxy:
    external: true

New container but it have account

Hello,I use portainer-composer for a while, it's very handy . Until I forgot portainer's account password some day last week. I try to remove all containers , all images , and all volumes of portainer-compose ,restart docker and rebuild it , but I failed . the portainer allways have an admin account that I do not know the password . Portainer can't reset admin account , what should I do ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.