Skip to content

Instantly share code, notes, and snippets.

@RyanWor
Forked from marcelo-ochoa/docker-compose-nginx.yml
Last active December 1, 2021 23:39
Show Gist options
  • Save RyanWor/04a112cc1b3f92e4d8f8f147b0e74f1e to your computer and use it in GitHub Desktop.
Save RyanWor/04a112cc1b3f92e4d8f8f147b0e74f1e to your computer and use it in GitHub Desktop.
A docker stack deploy for NGINX working as frontend for Portainer.IO and docker private registry
version: '3.6'
services:
server:
image: nginx
hostname: www.ryann.dev
networks:
- lb_network
ports:
- "80:80"
environment:
- TIMEZONE=America/New_York
volumes:
- html:/usr/share/nginx/html:ro
deploy:
mode: replicated
replicas: 2
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
configs:
- source: nginx.conf
target: /etc/nginx/nginx.conf
uid: '0'
gid: '0'
mode: 0644
- source: portainer.conf
target: /etc/nginx/conf.d/portainer.conf
uid: '0'
gid: '0'
mode: 0644
- source: registry.conf
target: /etc/nginx/conf.d/registry.conf
uid: '0'
gid: '0'
mode: 0644
- source: registry-ui.conf
target: /etc/nginx/conf.d/registry-ui.conf
uid: '0'
gid: '0'
mode: 0644
configs:
nginx.conf:
external: true
portainer.conf:
external: true
registry.conf:
external: true
registry-ui.conf:
external: true
volumes:
html:
driver: glusterfs
name: "myvolume/html"
networks:
lb_network:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment