TimWolla / docker-adminer

Database management in a single PHP file
https://hub.docker.com/_/adminer/
157 stars 69 forks source link

Pass different port to adminer #81

Closed tillias closed 3 years ago

tillias commented 3 years ago

Hello folks,

Thanks for a very nice product. Is there any possibility to define custom port for adminer? I'm using docker compose and internal port 8080 is already bound:

...microservice-catalog>docker-compose up
Creating network "microservice-catalog_default" with the default driver
Creating microservice-catalog_adminer_1 ...
Creating microservice-catalog_microcatalog_1 ...
Creating microservice-catalog_microcatalog_1 ... error
WARNING: Host is already in use by another container
Creating microservice-catalog_adminer_1      ... done
ERROR: for microservice-catalog_microcatalog_1  Cannot start service microcatalog: driver failed programming external connectivity on endpoint microservice-catalog_microcatalog_1 (ef2bdfa5426b8bb7f44Creating microservice-catalog_db_1           ... done
ERROR: for microcatalog  Cannot start service microcatalog: driver failed programming external connectivity on endpoint microservice-catalog_microcatalog_1 (ef2bdfa5426b8bb7f44af95f6eb47e91753035784e5346c2c3e18149b064de34): Bind for 0.0.0.0:8080 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.                  

You can reproduce it via

version: '3.1'
services:
  db:
    image: postgres
    restart: always
    environment:
      POSTGRES_PASSWORD: kEt#uR6M
  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:9080
  microcatalog:
    image: tillias/microcatalog
    restart: always
    environment:
      DB_HOST: db
      DB_PORT: 5432
      DB_NAME: postgres
      DB_PASSWORD: kEt#uR6M
      DB_USER: postgres
      CSP_IMAGE_SRC: '*'
    ports:
      - 8080:8080
TimWolla commented 3 years ago

Is there any possibility to define custom port for adminer?

Sure, specify a different external port in your docker-compose.yml. I believe you got the order of the ports mixed up in 8080:9080, It's host port:container port.

tillias commented 3 years ago

Hi Tim, you rock, many thanks! That is exactly the case, when I miss Four eyes principle in open source development badly