forked from tldr-devops/startpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
registry.yml
69 lines (63 loc) · 2.12 KB
/
registry.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
version: '3.8'
x-registry-labels: ®istry-labels
labels:
- traefik.enable=true
- traefik.docker.network=registry
- traefik.http.middlewares.registry-auth.basicauth.users=${REGISTRY_USERNAME?Variable REGISTRY_USERNAME not set}:${REGISTRY_HASHED_PASSWORD?Variable REGISTRY_HASHED_PASSWORD not set}
- traefik.http.routers.registry-http.rule=Host(`registry.${DOMAIN?Variable DOMAIN not set}`)
- traefik.http.routers.registry-http.entrypoints=http
- traefik.http.routers.registry-http.middlewares=registry-auth
- traefik.http.routers.registry-http.service=registry
#- traefik.http.routers.registry-http.middlewares=https-redirect
- traefik.http.routers.registry-https.rule=Host(`registry.${DOMAIN?Variable DOMAIN not set}`)
- traefik.http.routers.registry-https.entrypoints=https
- traefik.http.routers.registry-https.middlewares=registry-auth
- traefik.http.routers.registry-https.tls=true
- traefik.http.routers.registry-https.service=registry
- traefik.http.routers.registry-https.tls.certresolver=le
- traefik.http.services.registry.loadbalancer.server.port=5000
x-service: &service
logging:
driver: json-file
options:
max-size: "100m"
max-file: "2"
restart: always
networks:
- registry
services:
# https://docs.docker.com/registry/configuration/
registry:
container_name: registry
image: registry:2
deploy:
mode: replicated
replicas: 1
resources:
reservations:
cpus: '0.01'
memory: 10M
<<: *registry-labels
<<: *registry-labels
<<: *service
environment:
REGISTRY_HTTP_DEBUG_PROMETHEUS_ENABLED: "true"
REGISTRY_HTTP_SECRET: ${MASTER_IP?Variable MASTER_IP not set} # just random unique data
volumes:
- registry-data:/var/lib/registry
x-volume: &volume
driver: local
x-volume-driver-opts: &volume-driver-opts
type: none
o: bind
volumes:
registry-data:
name: registry-data
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/registry/data
networks:
registry:
name: registry
external: true