Skip to content

Commit 792333d

Browse files
committed
feat: Add terraform configuration for Keycloak
To make the current Keycloak setup more transparent and to make testing new changes easier in local development, add a Keycloak setup with Terraform and add Keycloak and Terraform to the Docker Compose setup. Signed-off-by: Johanna Lamppu <[email protected]>
1 parent 3433128 commit 792333d

File tree

6 files changed

+694
-1
lines changed

6 files changed

+694
-1
lines changed

Diff for: .gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,8 @@ generated-zod-schemas/
153153
.clever.json
154154

155155
# Yarn lockfile
156-
yarn.lock
156+
yarn.lock
157+
158+
# Terraform
159+
terraform/.terraform/*
160+
terraform/terraform.tfstate*

Diff for: docker-compose.yml

+28
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,34 @@ services:
7777
condition: service_healthy
7878
required: true
7979

80+
keycloak:
81+
image: quay.io/keycloak/keycloak:26.1.4
82+
command: start-dev
83+
ports:
84+
- "8083:8080"
85+
environment:
86+
- KC_BOOTSTRAP_ADMIN_USERNAME=keycloak-admin
87+
- KC_BOOTSTRAP_ADMIN_PASSWORD=keycloak-admin
88+
healthcheck:
89+
test: timeout 10s bash -c ':> /dev/tcp/localhost/8080'
90+
interval: 10s
91+
timeout: 5s
92+
retries: 20
93+
94+
terraform:
95+
build:
96+
context: ./terraform
97+
working_dir: /workspace
98+
volumes:
99+
- ./terraform:/workspace
100+
depends_on:
101+
keycloak:
102+
condition: service_healthy
103+
entrypoint: ["/bin/sh", "-c"]
104+
command: >
105+
"terraform init &&
106+
terraform apply -auto-approve"
107+
80108
api:
81109
build:
82110
dockerfile: API.Dockerfile

Diff for: terraform/.terraform.lock.hcl

+46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: terraform/Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-FileCopyrightText: 2025 Double Open Oy
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
FROM hashicorp/terraform:1.6
6+
7+
RUN apk add --no-cache curl jq bash

0 commit comments

Comments
 (0)