Skip to content

Instantly share code, notes, and snippets.

@jeckel jeckel/Dockerfile
Created Dec 13, 2017

Embed
What would you like to do?
Portainer with NGinx
version: '2'
# Configure a dedicated volume for storing Portainer's configuration
#
volumes:
portainer_data:
services:
# Configure Portainer service
#
portainer:
image: portainer/portainer
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
command: -H unix:///var/run/docker.sock
restart: always
networks:
- local
# Configure NGinx proxy service
#
nginx:
build: docker/
ports:
- "80:80"
depends_on:
- portainer
restart: always
networks:
- local
# Link network to the docker bridge driver
#
networks:
local:
driver: bridge
FROM nginx:alpine
MAINTAINER Julien MERCIER <devci@j3ck3l.me>
# Remove existing configuration
RUN rm -v /etc/nginx/conf.d/*
# Insert our portainer conf
COPY portainer.conf /etc/nginx/conf.d/portainer.conf
upstream portainer {
server portainer:9000;
}
server {
listen 80;
location / {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://portainer/;
}
location /api/websocket/ {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_pass http://portainer/api/websocket/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.