Giter Site home page Giter Site logo

Comments (2)

salvacorts avatar salvacorts commented on July 18, 2024

Hi @fabiante, Docker links are a legacy feature that may be removed in the future as you can read in the note bellow.

Warning: The --link flag is a legacy feature of Docker. It may eventually be removed. Unless you absolutely need to continue using it, we recommend that you use user-defined networks to facilitate communication between two containers instead of using --link. One feature that user-defined networks do not support that you can do with --link is sharing environmental variables between containers. However, you can use other mechanisms such as volumes to share environment variables between containers in a more controlled way.
Legacy container links

In this case I would recommend you using docker networks.
You need to create a network for Mautic and MySQL and then set all the env variables needed to make them able to communicate between them.
Also, you can make all data from DB and Mautic persistent across reboots with volumes.

This is the content of my docker deployment configuration files:

docker-compose.yml

version: '3.0'
services:
  mautic:
    image: mautic/mautic
    ports:
      - "80:80"
    env_file:
      - mautic.env
    volumes:
      - mautic-data:/var/www/html
    networks:
      - mautic-net
    depends_on:
      - db-mautic
  db-mautic:
    image: mysql:5.6
    volumes:
      - db-mautic-data:/var/lib/mysql
    env_file:
      - mautic.env
    networks:
      - mautic-net

volumes:
  db-mautic-data:
  mautic-data:

networks:
  mautic-net:

mautic.env

MYSQL_HOST=db-mautic
MYSQL_ROOT_PASSWORD=sierra75nevada
MYSQL_USER=mautic
MYSQL_PASSWORD=mautic
MYSQL_DATABASE=mautic

MAUTIC_DB_HOST=db-mautic:3306
MAUTIC_DB_USER=mautic
MAUTIC_DB_PASSWORD=mautic
MAUTIC_DB_NAME=mautic

If you wish, you can learn more about Docker networks here:

Have a nice day!

from docker-mautic.

fabiante avatar fabiante commented on July 18, 2024

Thank you! I got it working some weeks ago with a similar setup.

from docker-mautic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.