Project

General

Profile

Is it possible to connect wit the docker setup to a database on the same workstation ?

Added by Christian Eichert 2 days ago

I have a docker setup on my workstation, and I was up to connect it to the localhost MySQL database. (like this :)

services:
  redmine:
    image: redmine:alpine
    restart: always
    ports:
      - 80:3000
    environment:
      REDMINE_DB_MYSQL: 127.0.0.1
      REDMINE_DB_PORT: 3306
      REDMINE_DB_USERNAME: redmine
      REDMINE_DB_PASSWORD: redmine
      REDMINE_DB_DATABASE: redmine
      REDMINE_SECRET_KEY_BASE: supersecretkey

I was not successful because the container was trying to connect inside to the 127.0.0.1, respectively to the socket.
what is the right setup for this?