Skip to content

Instantly share code, notes, and snippets.

@hoangddt hoangddt/docker-command.sh
Last active Jan 21, 2019

Embed
What would you like to do?
Docker compose keycloak, Postgres Database
#!/bin/bash
docker run --rm -p 8888:8080 -e POSTGRES_USER=keycloak -e POSTGRES_DATABASE=keycloak_db -e POSTGRES_PASSWORD=4vSm/fNxO6LHSymo3yVPgQ== -e POSTGRES_PORT_5432_TCP_ADDR=postgres.default -e POSTGRES_PORT_5432_TCP_PORT='5432' my-keycloak
docker run --name=postgres -p 5432:5432 -e POSTGRES_USER=keycloak -e POSTGRES_DB=keycloak_db -e POSTGRES_PASSWORD=local postgres
psql -h localhost -p 5432 -U keycloak keycloak_db
docker run -it --rm --link postgres:postgres postgres psql -h postgres -U keycloak keycloak_db
docker run --rm -p 8888:8080 --link postgres:postgres -e POSTGRES_USER=keycloak -e POSTGRES_DATABASE=keycloak_db -e POSTGRES_PASSWORD=local -e POSTGRES_PORT_5432_TCP_ADDR=postgres -e POSTGRES_PORT_5432_TCP_PORT='5432' my-keycloak
version: '3'
volumes:
postgres-data:
services:
postgres:
image: postgres
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: db_keycloak_blank
POSTGRES_USER: db_keycloak
POSTGRES_PASSWORD: AFFgtdmZdGjG7SAs
keycloak:
image: jboss/keycloak:4.5.0.Final
ports:
- 8080:8080
environment:
DB_VENDOR: postgres
DB_USER: db_keycloak
DB_DATABASE: db_keycloak_blank
DB_PASSWORD: AFFgtdmZdGjG7SAs
DB_ADDR: postgres
PROXY_ADDRESS_FORWARDING: "false"
DB_PORT: '5432'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.