Skip to content

Instantly share code, notes, and snippets.

@alecharp
Created January 12, 2019 12:28
Show Gist options
  • Save alecharp/65330ddfdcc71a19db540f0d1517dd66 to your computer and use it in GitHub Desktop.
Save alecharp/65330ddfdcc71a19db540f0d1517dd66 to your computer and use it in GitHub Desktop.
version: "3.6"
services:
traefik:
image: traefik:1.7.7-alpine
command: --api --docker
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- jimmy-net
auth-db:
image: postgres:10-alpine
volumes:
- auth_db_data:/var/lib/postgresql/data
env_file:
- .auth-db-env
networks:
- jimmy-auth-net
expose:
- '5432'
auth:
image: jboss/keycloak:4.8.2.Final
labels:
- 'traefik.frontend.rule=Host:auth.jimmy.local'
- 'traefik.docker.network=jimmy-net'
- 'traefik.docker.port=8080'
environment:
- DB_VENDOR=POSTGRES
- DB_ADDR=auth-db
- PROXY_ADDRESS_FORWARDING=true
env_file:
- .auth-env
depends_on:
- auth-db
networks:
- jimmy-auth-net
- jimmy-net
expose:
- '8080'
back-db:
image: postgres:10-alpine
volumes:
- back_db_data:/var/lib/postgresql/data
env_file:
- .db-env
networks:
- jimmy-db-net
expose:
- '5432'
back:
image: alecharp/jimmy-back:latest
labels:
- 'traefik.frontend.rule=Host:api.jimmy.local'
- 'traefik.docker.network=jimmy-net'
- 'traefik.docker.port=8080'
env_file:
- .db-env
- .keycloak-client-env
environment:
- POSTGRES_HOST=back-db
- SPRING_PROFILES_ACTIVE=production
- KEYCLOAK_URL=http://auth.jimmy.local/auth/
- KEYCLOAK_CLIENT_ID=jimmy-back
depends_on:
- back-db
- auth
networks:
- jimmy-db-net
- jimmy-net
expose:
- '8080'
front:
image: alecharp/jimmy-front:latest
labels:
- 'traefik.frontend.rule=Host:jimmy.local'
- 'traefik.docker.network=jimmy-net'
- 'traefik.docker.port=4000'
env_file:
- .keycloak-client-env
environment:
- KEYCLOAK_URL=http://auth.jimmy.local:8080/auth/
- KEYCLOAK_CLIENT_ID=jimmy-front
- BACKEND_URL=http://api.jimmy.local/
- PORT=4000
depends_on:
- back
- auth
networks:
- jimmy-net
expose:
- "4000"
networks:
jimmy-auth-net:
name: jimmy-auth-net
internal: true
jimmy-db-net:
name: jimmy-db-net
internal: true
jimmy-net:
name: jimmy-net
volumes:
auth_db_data:
back_db_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment