| # Licensed to the Apache Software Foundation (ASF) under one | |
| # or more contributor license agreements. See the NOTICE file | |
| # distributed with this work for additional information | |
| # regarding copyright ownership. The ASF licenses this file | |
| # to you under the Apache License, Version 2.0 (the | |
| # "License"); you may not use this file except in compliance | |
| # with the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, | |
| # software distributed under the License is distributed on an | |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| # KIND, either express or implied. See the License for the | |
| # specific language governing permissions and limitations | |
| # under the License. | |
| # Example Docker Compose setup for running Roller, PostgreSQL, and Keycloak locally | |
| services: | |
| postgresql: | |
| image: "postgres:18" | |
| ports: | |
| - "5432:5432" | |
| volumes: | |
| - type: bind | |
| # A major version can't start on a data directory initialized by | |
| # an earlier one, so each gets its own directory and old data is | |
| # left alone. To migrate it, run the old image on the old | |
| # directory and pg_dump from that. The postgres:18 image keeps | |
| # its data in a versioned directory under /var/lib/postgresql. | |
| source: ./docker/postgresql-18-data | |
| target: /var/lib/postgresql | |
| environment: | |
| - POSTGRES_DB=rollerdb | |
| - POSTGRES_USER=scott | |
| - POSTGRES_PASSWORD=tiger | |
| keycloak: | |
| image: "quay.io/keycloak/keycloak:26.8.2" | |
| command: "start-dev --import-realm" | |
| volumes: | |
| - ./docker/realm-config:/opt/keycloak/data/import | |
| - ./docker/realm-config/keycloak-health-check.sh:/opt/keycloak/health-check.sh | |
| environment: | |
| - KC_DB=dev-file | |
| - KC_BOOTSTRAP_ADMIN_USERNAME=admin | |
| - KC_BOOTSTRAP_ADMIN_PASSWORD=admin | |
| - KC_HTTP_PORT=9080 | |
| - KC_HTTPS_PORT=9443 | |
| - KC_HEALTH_ENABLED=true | |
| - KC_HTTP_MANAGEMENT_PORT=9990 | |
| ports: | |
| - "127.0.0.1:9080:9080" | |
| - "127.0.0.1:9443:9443" | |
| healthcheck: | |
| test: "bash /opt/keycloak/health-check.sh" | |
| interval: 5s | |
| timeout: 5s | |
| retries: 50 | |
| start_period: 10s | |
| apache-roller: | |
| build: . | |
| ports: | |
| - "8080:8080" | |
| volumes: | |
| - type: bind | |
| source: ./docker/roller-data | |
| target: /var/lib/roller/data | |
| environment: | |
| # override with AUTHENTICATION_METHOD=db-oidc to offer form login too | |
| - AUTHENTICATION_METHOD=${AUTHENTICATION_METHOD:-oidc} | |
| # Roller discovers Keycloak's endpoints at this URL and then redirects | |
| # the browser to them, so the host must resolve both in this container | |
| # and on your machine. Add "127.0.0.1 keycloak" to your hosts file. | |
| - OIDC_ISSUER_URI=http://keycloak:9080/realms/roller | |
| - OIDC_CLIENT_ID=web_app | |
| - OIDC_CLIENT_SECRET=web_app | |
| depends_on: | |
| keycloak: | |
| condition: service_healthy |