version: '3'

networks:
  keycloak-network:

volumes:
    keycloak-postgres-data:
    keycloak-nginx-ssl:

services:
  postgres:
    image: postgres:9.6-alpine
    container_name: postgres
    networks:
      - keycloak-network
    volumes:
      - keycloak-postgres-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=keycloak
      - POSTGRES_USER=keycloak
      - POSTGRES_PASSWORD=password
  keycloak:
    image: jboss/keycloak-postgres
    container_name: keycloak
    links:
      - postgres
    networks:
      - keycloak-network
    depends_on:
      - postgres
    environment:
      - POSTGRES_DATABASE=keycloak
      - POSTGRES_USER=keycloak
      - POSTGRES_PASSWORD=password
      - PROXY_ADDRESS_FORWARDING=true
      - KEYCLOAK_USER=admin
      - KEYCLOAK_PASSWORD=admin
      - POSTGRES_JDBC_VERSION=42.1.4
      # JBoss is using legacy linking environment variables
      - POSTGRES_PORT_5432_TCP_ADDR=postgres
      - POSTGRES_PORT_5432_TCP_PORT=5432
  nginx:
    image: ernsheong/keycloak-nginx
    container_name: nginx
    networks:
      - keycloak-network
    depends_on:
      - keycloak
    volumes:
      - keycloak-nginx-ssl:/etc/nginx/ssl
    environment:
      - KEYCLOAK_HOST=keycloak
      - KEYCLOAK_PORT=8080
    ports:
      - "443:443"
version: '3'

networks:
  keycloak-network:

volumes:
    keycloak-postgres-data:
    keycloak-nginx-ssl:

services:
  postgres:
    image: postgres:9.6-alpine
    container_name: postgres
    networks:
      - keycloak-network
    volumes:
      - keycloak-postgres-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=keycloak
      - POSTGRES_USER=keycloak
      - POSTGRES_PASSWORD=password
  keycloak:
    image: ernsheong/keycloak-postgres
    container_name: keycloak
    links:
      - postgres
    networks:
      - keycloak-network
    depends_on:
      - postgres
    environment:
      - POSTGRES_DATABASE=keycloak
      - POSTGRES_USER=keycloak
      - POSTGRES_PASSWORD=password
      - PROXY_ADDRESS_FORWARDING=true
      - KEYCLOAK_USER=admin
      - KEYCLOAK_PASSWORD=admin
      - POSTGRES_JDBC_VERSION=42.1.4
      # JBoss is using legacy linking environment variables
      - POSTGRES_PORT_5432_TCP_ADDR=postgres
      - POSTGRES_PORT_5432_TCP_PORT=5432
  nginx:
    image: ernsheong/keycloak-nginx
    container_name: nginx
    networks:
      - keycloak-network
    depends_on:
      - keycloak
    volumes:
      - keycloak-nginx-ssl:/etc/nginx/ssl
    environment:
      - KEYCLOAK_HOST=keycloak
      - KEYCLOAK_PORT=8080
    ports:
      - "443:443"
Switch to keycloak-postgres with curl fix
Switch to keycloak-postgres with curl fix
