fix(compose): Use 1 psql db instead of 2 (#23)
* fix(compose): Use 1 psql db instead of 2 * chore: fix kc db config * chore: clean env --------- Co-authored-by: Louis <louis@jan.ai>
This commit is contained in:
parent
38424891e3
commit
c5397184ee
26
conf/db/docker_psql_init.sql
Normal file
26
conf/db/docker_psql_init.sql
Normal file
@ -0,0 +1,26 @@
|
||||
CREATE DATABASE "jan-keycloak"
|
||||
WITH
|
||||
OWNER = postgres
|
||||
ENCODING = 'UTF8'
|
||||
LC_COLLATE = 'en_US.utf8'
|
||||
LC_CTYPE = 'en_US.utf8'
|
||||
TABLESPACE = pg_default
|
||||
CONNECTION LIMIT = -1;
|
||||
|
||||
CREATE DATABASE "jan-hasura-data"
|
||||
WITH
|
||||
OWNER = postgres
|
||||
ENCODING = 'UTF8'
|
||||
LC_COLLATE = 'en_US.utf8'
|
||||
LC_CTYPE = 'en_US.utf8'
|
||||
TABLESPACE = pg_default
|
||||
CONNECTION LIMIT = -1;
|
||||
|
||||
CREATE DATABASE "jan-hasura-metadata"
|
||||
WITH
|
||||
OWNER = postgres
|
||||
ENCODING = 'UTF8'
|
||||
LC_COLLATE = 'en_US.utf8'
|
||||
LC_CTYPE = 'en_US.utf8'
|
||||
TABLESPACE = pg_default
|
||||
CONNECTION LIMIT = -1;
|
||||
@ -1,7 +1,7 @@
|
||||
## postgres database to store Hasura metadata
|
||||
HASURA_GRAPHQL_METADATA_DATABASE_URL=postgres://postgres:postgrespassword@postgres:5432/postgres
|
||||
HASURA_GRAPHQL_METADATA_DATABASE_URL=postgres://postgres:postgrespassword@postgres:5432/jan-hasura-metadata
|
||||
## this env var can be used to add the above postgres database to Hasura as a data source. this can be removed/updated based on your needs
|
||||
PG_DATABASE_URL=postgres://postgres:postgrespassword@postgres:5432/postgres
|
||||
PG_DATABASE_URL=postgres://postgres:postgrespassword@postgres:5432/jan-hasura-data
|
||||
## enable the console served by server
|
||||
HASURA_GRAPHQL_ENABLE_CONSOLE="true" # set to "false" to disable console
|
||||
## enable debugging mode. It is recommended to disable this in production
|
||||
|
||||
@ -7,11 +7,11 @@ services:
|
||||
command: ["start-dev", "--import-realm", "--http-port", "8088"]
|
||||
environment:
|
||||
KC_DB: postgres
|
||||
KC_DB_URL_HOST: keycloak_postgres
|
||||
KC_DB_URL_DATABASE: ${POSTGRES_DB_NAME:-keycloak}
|
||||
KC_DB_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
||||
KC_DB_USERNAME: ${POSTGRES_USERNAME:-postgres}
|
||||
KC_DB_SCHEMA: ${KC_DB_SCHEMA:-public}
|
||||
KC_DB_URL_HOST: postgres
|
||||
KC_DB_URL_DATABASE: jan-keycloak
|
||||
KC_DB_PASSWORD: postgrespassword
|
||||
KC_DB_USERNAME: postgres
|
||||
KC_DB_SCHEMA: public
|
||||
KC_HEALTH_ENABLED: "true"
|
||||
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN-admin}
|
||||
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD-admin}
|
||||
@ -20,37 +20,25 @@ services:
|
||||
ports:
|
||||
- "8088:8088"
|
||||
depends_on:
|
||||
keycloak_postgres:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
jan_community:
|
||||
ipv4_address: 172.20.0.9
|
||||
|
||||
keycloak_postgres:
|
||||
image: postgres:15
|
||||
command: postgres -c 'max_connections=200' && postgres -c 'shared_buffers=24MB'
|
||||
environment:
|
||||
# Environment Variables expecially for Postgres
|
||||
POSTGRES_DB: ${POSTGRES_DB_NAME:-keycloak}
|
||||
POSTGRES_USER: ${POSTGRES_USERNAME:-postgres}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
||||
PGDATA: /data/postgres
|
||||
PGPORT: ${POSTGRES_PORT:-5432}
|
||||
healthcheck:
|
||||
test: "exit 0"
|
||||
|
||||
ports:
|
||||
- ${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}
|
||||
networks:
|
||||
jan_community:
|
||||
ipv4_address: 172.20.0.10
|
||||
|
||||
postgres:
|
||||
image: postgres:15
|
||||
command: postgres -c jit=off
|
||||
restart: always
|
||||
|
||||
env_file:
|
||||
- conf/sample.env_app-backend-postgres
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgrespassword
|
||||
ports:
|
||||
- "5432:5432"
|
||||
healthcheck:
|
||||
test: "exit 0"
|
||||
volumes:
|
||||
- ./conf/db/docker_psql_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql
|
||||
networks:
|
||||
jan_community:
|
||||
ipv4_address: 172.20.0.11
|
||||
|
||||
@ -1,9 +1,4 @@
|
||||
KEYCLOAK_VERSION=22.0.0
|
||||
POSTGRES_DB_NAME=keycloak
|
||||
POSTGRES_PASSWORD=postgres
|
||||
POSTGRES_USERNAME=postgres
|
||||
POSTGRES_PORT=5432
|
||||
KC_DB_SCHEMA=public
|
||||
KEYCLOAK_ADMIN=admin
|
||||
KEYCLOAK_ADMIN_PASSWORD=admin
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user