dev env setup

This commit is contained in:
tw-blue
2025-12-06 21:27:29 +01:00
parent 987a380758
commit bc9f0f9f3b
38 changed files with 5953 additions and 733 deletions
+48
View File
@@ -0,0 +1,48 @@
services:
postgres:
build:
context: .
dockerfile: ./postgres.DOCKERFILE
container_name: dev-postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: devpassword
POSTGRES_INITDB_ARGS: "--locale=de_DE.utf8 --lc-collate=de_DE.utf8 --lc-ctype=de_DE.utf8"
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql
- ./postgres/initdb:/docker-entrypoint-initdb.d/
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
keycloak:
image: quay.io/keycloak/keycloak:26.4
container_name: dev-keycloak
command:
- start-dev
- --import-realm
environment:
KC_HOSTNAME: localhost
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: devpassword
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
volumes:
- ./keycloak/realm-export:/opt/keycloak/data/import
- keycloak_data:/opt/keycloak/data
volumes:
postgres_data:
keycloak_data:
+8
View File
@@ -0,0 +1,8 @@
FROM postgres:18
RUN apt-get update \
&& apt-get install -y locales \
&& sed -i '/de_DE.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen
ENV LANG=de_DE.utf8
+9
View File
@@ -0,0 +1,9 @@
CREATE ROLE webapi WITH
LOGIN
NOSUPERUSER
INHERIT
NOCREATEDB
NOCREATEROLE
NOREPLICATION
NOBYPASSRLS
PASSWORD 'devpassword';
@@ -0,0 +1,23 @@
CREATE ROLE keycloak WITH
LOGIN
NOSUPERUSER
INHERIT
NOCREATEDB
NOCREATEROLE
NOREPLICATION
NOBYPASSRLS
PASSWORD 'devpassword';
CREATE DATABASE keycloak
WITH
OWNER = keycloak
ENCODING = 'UTF8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1
IS_TEMPLATE = False;
-- TODO
-- Replace Client Secret in realm-export.json
-- replace Frontend redirect URLS in realm-export.json
-- SET NODE_ENV=production when running on server
-- SET DEFAULT_PERSISSIONS for webapi user
@@ -0,0 +1,9 @@
CREATE ROLE prisma WITH
LOGIN
NOSUPERUSER
INHERIT
CREATEDB
NOCREATEROLE
NOREPLICATION
NOBYPASSRLS
PASSWORD 'devpassword';