I’m trying to start a container that contains apache and keycloak and configure the openoidc in it.
This is my docker-compose:
version: "3.8"
services:
frontend:
build: ./frontend
container_name: frontend
platform: linux/arm64/v8
expose:
- "4200"
ports:
- 4200:4200
environment:
- KEYCLOAK_URL=http://keycloak:8080
- KEYCLOAK_REALM=master
- KEYCLOAK_CLIENT_ID=frontend
depends_on:
- keycloak
keycloak:
image: quay.io/keycloak/keycloak:19.0.2
container_name: keycloak
expose:
- "8080"
- "9990"
ports:
- 8080:8080
environment:
DB_VENDOR: POSTGRES
DB_ADDR: postgres
DB_DATABASE: keycloak
DB_USER: keycloak
DB_SCHEMA: public
DB_PASSWORD: password
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
entrypoint: ["/opt/keycloak/bin/kc.sh", "start-dev"]
depends_on:
- postgres
mockoon:
build:
context: ./frontend/module-federation-configuration/mockoon
dockerfile: Dockerfile
container_name: mockoon-one-container
ports:
- "3001:3001"
depends_on:
- postgres
postgres:
image: postgres:13.0-alpine
container_name: postgres
ports:
- 5432:5432
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- postgres:/var/lib/postgresql/data
- ./infra/postgres:/docker-entrypoint-initdb.d
volumes:
postgres:
And I’m having issues inside the apache to retrieve the openoidc configuration (everytime that the user try to enter to the server, this file is called), I’m receiving a timeout:
{ "type":"error", "host":"localhost", "timestamp":"2024-05-10 16:43:02.245778", "module": "auth_openidc:error", "pid": "1210", "thread_id": "275093427968", "source_file": " ", "client_ip": " 172.23.0.1:36164 ", "message": "oidc_util_http_call: curl_easy_perform() failed on: http://keycloak:8080/realms/master/.well-known/openid-configuration (Connection timed out after 5002 milliseconds)", "referer": " " }
2024-05-10 17:43:02 { "type":"error", "host":"localhost", "timestamp":"2024-05-10 16:43:02.246884", "module": "auth_openidc:error", "pid": "1210", "thread_id": "275093427968", "source_file": " ", "client_ip": " 172.23.0.1:36164 ", "message": "oidc_provider_static_config: could not retrieve metadata from url: http://keycloak:8080/realms/master/.well-known/openid-configuration", "referer": " " }
But the strange behavior is that if I try via terminal I can reach it:
Do you have any idea what can cause this issue?
I’ve tried to add a network but unfortunately there is no result. I don’t know if it has any other option for that. Could it be some configuration inside httpd.conf?