Created
November 24, 2018 19:36
-
-
Save nikhiljohn10/8f8c96b1f89d5df0e3c8c1fd93e8e988 to your computer and use it in GitHub Desktop.
Portainer Registry Stack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.2" | |
| services: | |
| cache: | |
| image: redis:alpine | |
| volumes: | |
| - cache:/bitnami/redis/data | |
| networks: | |
| - registry | |
| environment: | |
| REDIS_PASSWORD: /run/secrets/password | |
| secrets: | |
| - password | |
| deploy: | |
| placement: | |
| constraints: | |
| - 'node.role == manager' # This can be changed to 'worker' if worker nodes are available | |
| - 'node.platform.os == linux' | |
| registry: | |
| image: registry:2 | |
| volumes: | |
| - registry:/var/lib/registry | |
| ports: | |
| - 5050:5050 | |
| networks: | |
| - registry | |
| environment: | |
| REGISTRY_HTTP_ADDR: "0.0.0.0:5050" | |
| REGISTRY_HTTP_SECRET: /run/secrets/httpSecret | |
| REGISTRY_HTTP_TLS_CERTIFICATE: /run/secrets/fullchain.crt | |
| REGISTRY_HTTP_TLS_KEY: /run/secrets/private.key | |
| REGISTRY_STORAGE_CACHE_BLOBDESCRIPTOR: "redis" | |
| REGISTRY_REDIS_ADDR: "cache:6379" | |
| REGISTRY_REDIS_PASSWORD: /run/secrets/password | |
| secrets: | |
| - fullchain.crt | |
| - private.key | |
| - httpSecret | |
| - password | |
| deploy: | |
| placement: | |
| constraints: | |
| - 'node.role == manager' | |
| - 'node.platform.os == linux' | |
| # Secrets must be created before deploying this stack in portainer | |
| secrets: | |
| fullchain.crt: | |
| external: true | |
| private.key: | |
| external: true | |
| password: | |
| external: true | |
| httpSecret: | |
| external: true | |
| volumes: | |
| registry: | |
| cache: | |
| networks: | |
| registry: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment