Is it possible to expose http ports with docker-compose?

Viewed 4100

I am running postgres and keycloak images on my local machine. Both of this images have exposed ports configured. But docker machine only exposing ports via TCP. So I was able to connect to the postgres via TCP, but was not able to connect to the keycloack's localhost:8080 via HTTP.

So is it possible to connect to the docker exposed ports via HTTP.

docker-compose.yml

postgres:
image: postgres:9.6.3
volumes:
    - ./db/init:/docker-entrypoint-initdb.d
environment:
    - POSTGRES_USER=root
    - POSTGRES_PASSWORD=root
ports:
    - 5432:5432

keycloak:
image: jboss/keycloak-postgres
environment:
    - KEYCLOAK_LOGLEVEL=DEBUG
    - POSTGRES_DATABASE=user-service
    - POSTGRES_USER=root
    - POSTGRES_PASSWORD=root
links:
    - postgres:postgres
ports:
    - "8080:8080"
    - "9999:9990"
    - "443:8443"
volumes:
    - ./data:/data

docker ps

2 Answers
Related