Skip to content

Commit

Permalink
Add run target
Browse files Browse the repository at this point in the history
Signed-off-by: John Gomersall <thegoms@gmail.com>
  • Loading branch information
john-gom committed May 6, 2024
1 parent 15ca45f commit 9c949a8
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ KEYCLOAK_ADMIN=root
KEYCLOAK_ADMIN_PASSWORD=test
KEYCLOAK_BASE_URL=http://auth.openfoodfacts.localhost:5600
KEYCLOAK_REALM_NAME=open-products-facts
KEYCLOAK_TAG=main

KC_DB_USERNAME=keycloak
KC_DB_PASSWORD=Secret123!
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ refresh_themes:
rm keycloak-${KEYCLOAK_VERSION}.tar.gz
rm org.keycloak.keycloak-themes-${KEYCLOAK_VERSION}.jar
node build-scripts/refresh_messages.mjs

run:
docker compose -f docker-compose-run.yml up -d
52 changes: 52 additions & 0 deletions docker-compose-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
services:
keycloak:
# FIXME: Add keycloak to docker-compose.yml and/or docker/prod.yml
image: ghcr.io/openfoodfacts/openfoodfacts-auth:${KEYCLOAK_TAG}

environment:
- KEYCLOAK_ADMIN
- KEYCLOAK_ADMIN_PASSWORD
- KEYCLOAK_BASE_URL
- KEYCLOAK_REALM_NAME
- KC_DB=postgres
- KC_DB_URL_HOST=keycloak_postgres
- KC_DB_USERNAME
- KC_DB_PASSWORD
- KC_SPI_EVENTS_LISTENER_REDIS_EVENT_LISTENER_REDIS_URL=${REDIS_URL}

ports:
- "0.0.0.0:${KEYCLOAK_EXPOSE_PORT:-5600}:8080"
depends_on:
keycloak_postgres:
condition: service_started
redis:
condition: service_started
smtp:
condition: service_started

keycloak_postgres:
image: postgres:12-alpine
environment:
- POSTGRES_USER=${KC_DB_USERNAME}
- POSTGRES_PASSWORD=${KC_DB_PASSWORD}
volumes:
- dbdata:/var/lib/postgresql/data
ports:
- 5601:5432

redis:
image: redis:7-alpine
volumes:
- redisdata:/data

smtp:
image: rnwood/smtp4dev:3.3.4-ci20240323113
volumes:
- smtpdata:/smtp4dev
ports:
- 2580:8080

volumes:
dbdata:
redisdata:
smtpdata:
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
keycloak:
# FIXME: Add keycloak to docker-compose.yml and/or docker/prod.yml
image: ghcr.io/openfoodfacts/openfoodfacts-auth:main
image: ghcr.io/openfoodfacts/openfoodfacts-auth:dev
build:
context: .
dockerfile: Dockerfile
Expand All @@ -20,7 +20,7 @@ services:
- KC_SPI_EVENTS_LISTENER_REDIS_EVENT_LISTENER_REDIS_URL=${REDIS_URL}

ports:
- "127.0.0.1:${KEYCLOAK_EXPOSE_PORT:-5600}:8080"
- "0.0.0.0:${KEYCLOAK_EXPOSE_PORT:-5600}:8080"
volumes:
- ./theme/off:/opt/keycloak/themes/off
depends_on:
Expand Down

0 comments on commit 9c949a8

Please sign in to comment.