Skip to content

Commit

Permalink
chore: modifications to support mysql dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood committed Oct 1, 2024
1 parent 8272274 commit e5b7498
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-db-migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
-
name: Show initial migration logs
run: |
docker compose -p lagoon logs api-init
docker compose -p lagoon logs api-db-init
-
name: Initiate rollback
run: |
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
image: ${IMAGE_REPO:-lagoon}/api-db:${IMAGE_REPO_API_DB_TAG:-${IMAGE_REPO_TAG:-latest}}
ports:
- '3366:3306'
environment:
- MARIADB_PASSWORD=api
webhook-handler:
image: ${IMAGE_REPO:-lagoon}/webhook-handler:${IMAGE_REPO_WEBHOOK_HANDLER_TAG:-${IMAGE_REPO_TAG:-latest}}
ports:
Expand Down Expand Up @@ -156,13 +158,17 @@ services:
environment:
- KEYCLOAK_FRONTEND_URL=http://localhost:8088/auth/
- [email protected]
- DB_VENDOR=mysql
- LAGOON_DB_VENDOR=mysql
# Uncomment for local new relic tracking
# - NEW_RELIC_LICENSE_KEY=
# - NEW_RELIC_APP_NAME=keycloak-local
keycloak-db:
image: ${IMAGE_REPO:-lagoon}/keycloak-db:${IMAGE_REPO_KEYCLOAK_DB_TAG:-${IMAGE_REPO_TAG:-latest}}
ports:
- '3336:3306'
environment:
- MARIADB_PASSWORD=keycloak
tests-kubernetes:
image: ${IMAGE_REPO:-lagoon}/tests:${IMAGE_REPO_TESTS_TAG:-${IMAGE_REPO_TAG:-latest}}
environment:
Expand Down
6 changes: 4 additions & 2 deletions services/api-db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ ENV LAGOON_VERSION=$LAGOON_VERSION

ENV ALLOW_EMPTY_PASSWORD=yes \
MYSQL_USER=api \
MYSQL_PASSWORD=api \
MYSQL_DATABASE=infrastructure \
MYSQL_AUTHENTICATION_PLUGIN=mysql_native_password \
MYSQL_SQL_MODE=NO_ENGINE_SUBSTITUTION
MYSQL_SQL_MODE=NO_ENGINE_SUBSTITUTION \
DB_VOLUME_DIR=/var/lib/mysql

RUN sed -i 's/export MYSQL_PASSWORD="${MYSQL_PASSWORD:-}"/export MYSQL_PASSWORD="${MARIADB_PASSWORD:-api}"/g' /opt/bitnami/scripts/mysql-env.sh
6 changes: 4 additions & 2 deletions services/keycloak-db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ENV LAGOON_VERSION=$LAGOON_VERSION

ENV ALLOW_EMPTY_PASSWORD=yes \
MYSQL_USER=keycloak \
MYSQL_PASSWORD=keycloak \
MYSQL_DATABASE=keycloak \
MYSQL_AUTHENTICATION_PLUGIN=mysql_native_password
MYSQL_AUTHENTICATION_PLUGIN=mysql_native_password \
DB_VOLUME_DIR=/var/lib/mysql

RUN sed -i 's/export MYSQL_PASSWORD="${MYSQL_PASSWORD:-}"/export MYSQL_PASSWORD="${MARIADB_PASSWORD:-keycloak}"/g' /opt/bitnami/scripts/mysql-env.sh
4 changes: 2 additions & 2 deletions services/keycloak/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ENV TMPDIR=/tmp \
KEYCLOAK_ADMIN_PASSWORD=admin \
KEYCLOAK_REALM=lagoon \
KEYCLOAK_REALM_ROLES=admin \
DB_VENDOR=mariadb \
DB_VENDOR=mysql \
DB_ADDR=keycloak-db \
DB_USER=keycloak \
DB_PASSWORD=keycloak \
Expand All @@ -69,7 +69,7 @@ ENV TMPDIR=/tmp \
KEYCLOAK_API_CLIENT_SECRET=39d5282d-3684-4026-b4ed-04bbc034b61a \
KEYCLOAK_AUTH_SERVER_CLIENT_SECRET=f605b150-7636-4447-abd3-70988786b330 \
KEYCLOAK_SERVICE_API_CLIENT_SECRET=d3724d52-34d1-4967-a802-4d178678564b \
LAGOON_DB_VENDOR=mariadb \
LAGOON_DB_VENDOR=mysql \
LAGOON_DB_DATABASE=infrastructure \
LAGOON_DB_USER=api \
LAGOON_DB_PASSWORD=api \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export KC_DB=$DB_VENDOR
export KC_DB_USERNAME=$DB_USER
export KC_DB_PASSWORD=$DB_PASSWORD
export KC_DB_URL=jdbc:mariadb://$DB_ADDR:3306/$DB_DATABASE
export KC_DB_URL=jdbc:$DB_VENDOR://$DB_ADDR:3306/$DB_DATABASE

export KC_PROXY=${KC_PROXY:-edge}
export KC_HOSTNAME_STRICT=${KC_HOSTNAME_STRICT:-false}
Expand Down

0 comments on commit e5b7498

Please sign in to comment.