Skip to content

Instantly share code, notes, and snippets.

@jmkgreen
Created August 3, 2017 09:01
Show Gist options
  • Save jmkgreen/b79f95c3eca2eac3fb66c66d12017f07 to your computer and use it in GitHub Desktop.
Save jmkgreen/b79f95c3eca2eac3fb66c66d12017f07 to your computer and use it in GitHub Desktop.
KeyCloak docker-compose file for swarm stack launch purposes
version: '3.3'
services:
keycloak:
image: jboss/keycloak-mysql
environment:
- constraint:serverclass==gateway
- PROXY_ADDRESS_FORWARDING=true
- MYSQL_USER=keycloak
- MYSQL_PASSWORD=keycloak
- MYSQL_PORT_3306_TCP_ADDR=mysql
- MYSQL_PORT_3306_TCP_PORT=3306
networks:
- keycloak_self
- http_proxy
deploy:
labels:
- "traefik.port=8080"
- "traefik.docker.network=http_proxy"
- "traefik.frontend.rule=Host:keycloak-test.example.net, keycloak.example.net"
placement:
constraints:
- node.role != manager
mysql:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=my-root-password
- MYSQL_DATABASE=keycloak
- MYSQL_USER=keycloak
- MYSQL_PASSWORD=keycloak
volumes:
- mysql:/var/lib/mysql
networks:
- keycloak_self
deploy:
placement:
constraints:
- node.role != manager
volumes:
mysql:
driver: glusterfs
networks:
keycloak_self:
external: true
http_proxy:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment