Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@willopez
Created June 13, 2017 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willopez/068b43916d27fe5983ae87fce9f41a0d to your computer and use it in GitHub Desktop.
Save willopez/068b43916d27fe5983ae87fce9f41a0d to your computer and use it in GitHub Desktop.
Private docker registry
docker-compose.yml
==================================================================
version: '2'
services:
haproxy:
image: m21lab/haproxy:1.6.2
links:
- registry
- registry-ui
ports:
- '80:80'
- '443:443'
- '5000:5000'
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
registry:
build: ./registry
restart: always
volumes:
- /usr/local/lib/registrydata:/var/lib/registry
expose:
- 5000
environment:
TCP_PORTS: '5000'
VIRTUAL_HOST: '*:5000, https://*:5000'
FORCE_SSL: 'true'
REGISTRY_STORAGE_DELETE_ENABLED: 'true'
registry-ui:
image: konradkleine/docker-registry-frontend:v2
restart: always
environment:
VIRTUAL_HOST: '*, https://*'
ENV_DOCKER_REGISTRY_HOST: 'registry'
ENV_DOCKER_REGISTRY_PORT: 5000
links:
- registry
expose:
- 80
======================================================
docker-compose.ssl.yml
version: '2'
services:
haproxy:
image: m21lab/haproxy:1.6.2
links:
- letsencrypt
volumes_from:
- letsencrypt
letsencrypt:
image: m21lab/letsencrypt:1.0
environment:
DOMAINS: 'registry.noomadigital.com'
EMAIL: 'will.lopez77@gmail.com'
LOAD_BALANCER_SERVICE_NAME: 'haproxy'
OPTIONS: '--staging'
registry:
volumes_from:
- letsencrypt:ro
environment:
REGISTRY_HTTP_SECRET: "noomadigital_secret"
REGISTRY_HTTP_TLS_CERTIFICATE: /etc/letsencrypt/live/registrynoomadigital/fullchain.pem
REGISTRY_HTTP_TLS_KEY: /etc/letsencrypt/live/registrynoomadigital/privkey.pem
registry-ui:
environment:
FORCE_SSL: 'true'
ENV_REGISTRY_PROXY_FQDN: 'registry.noomadigital.com'
ENV_DOCKER_REGISTRY_USE_SSL: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment