GithubHelp home page GithubHelp logo

Traefik integration about espocrm-docker HOT 16 CLOSED

espocrm avatar espocrm commented on June 23, 2024
Traefik integration

from espocrm-docker.

Comments (16)

arkadiyasuratov avatar arkadiyasuratov commented on June 23, 2024 4

I managed to make it work with Traefik.

$ docker -v
Docker version 20.10.13, build a224086
$ docker-compose -v
docker-compose version 1.29.2, build unknown
$ docker exec -it traefik traefik version
Version:      2.5.4
Codename:     livarot
Go version:   go1.17.3
Built:        2021-11-08T17:41:41Z
OS/Arch:      linux/amd64

Usage with Traefik

---
version: '3.8'

services:

  mysql:
    image: mysql:8
    container_name: mysql
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_ROOT_PASSWORD: root_password
      MYSQL_DATABASE: espocrm
      MYSQL_USER: espocrm
      MYSQL_PASSWORD: database_password
    volumes:
      - mysql:/var/lib/mysql
    restart: always

  espocrm:
    image: espocrm/espocrm
    container_name: espocrm
    environment:
      ESPOCRM_DATABASE_HOST: mysql
      ESPOCRM_DATABASE_USER: espocrm
      ESPOCRM_DATABASE_PASSWORD: database_password
      ESPOCRM_ADMIN_USERNAME: admin
      ESPOCRM_ADMIN_PASSWORD: password
      ESPOCRM_SITE_URL: "https://${DOMAIN}"
    volumes:
      - espocrm:/var/www/html
    restart: always
    labels:
      - traefik.enable=true
      - traefik.docker.network=traefik_public
      - traefik.http.routers.espocrm-app.rule=Host(`${DOMAIN}`)
      - traefik.http.routers.espocrm-app.entrypoints=https
      - traefik.http.routers.espocrm-app.tls=true
      - traefik.http.routers.espocrm-app.tls.certresolver=letsencrypt

  espocrm-daemon:
    image: espocrm/espocrm
    container_name: espocrm-daemon
    volumes:
      - espocrm:/var/www/html
    restart: always
    entrypoint: docker-daemon.sh

  espocrm-websocket:
    image: espocrm/espocrm
    container_name: espocrm-websocket
    environment:
      ESPOCRM_CONFIG_USE_WEB_SOCKET: "true"
      ESPOCRM_CONFIG_WEB_SOCKET_URL: "wss://${DOMAIN}/ws"
      ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBSCRIBER_DSN: "tcp://*:7777"
      ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBMISSION_DSN: "tcp://espocrm-websocket:7777"
    volumes:
      - espocrm:/var/www/html
    restart: always
    entrypoint: docker-websocket.sh
    labels:
      - traefik.enable=true
      - traefik.docker.network=traefik_public
      - traefik.http.routers.espocrm-ws.rule=Host(`${DOMAIN}`) && PathPrefix(`/ws`)
      - traefik.http.routers.espocrm-ws.entrypoints=https
      - traefik.http.routers.espocrm-ws.tls=true
      - traefik.http.routers.espocrm-ws.tls.certresolver=letsencrypt
      - traefik.http.routers.espocrm-ws.service=espocrm-ws-service
      - traefik.http.services.espocrm-ws-service.loadbalancer.server.port=8080

volumes:
  mysql:
  espocrm:

networks:
  default:
    name: traefik_public
    external: true

from espocrm-docker.

tmachyshyn avatar tmachyshyn commented on June 23, 2024

Please check if you have specified traefik.docker.network: proxy.
What error do you have in traefik dashboard?

from espocrm-docker.

yahya077 avatar yahya077 commented on June 23, 2024

Thank you for your response. There is no error either traefik and docker-compose log. I connect to the container and checked to the apache server status and it is working. I couldn't find a problem to solve because I couldn't see an error message. Where am I doing wrong? I can serve on ip without using traefik, but I want to serve over domain with traefik

from espocrm-docker.

tmachyshyn avatar tmachyshyn commented on June 23, 2024

You can try to mount the /etc/apache2/sites-available/000-default.conf where define your domain name espocrm.mydomain.com.

from espocrm-docker.

yahya077 avatar yahya077 commented on June 23, 2024

My /etc/apache2/sites-available/000-default.conf file. After I update the file I reload the apache server and it still doesn't work.

<VirtualHost *:80>
	ServerName espocrm.mydomain.com

	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

from espocrm-docker.

tmachyshyn avatar tmachyshyn commented on June 23, 2024

This container of EspoCRM uses the php-apache image. Do you any other containers with the apache and PHP?

from espocrm-docker.

yahya077 avatar yahya077 commented on June 23, 2024

If you mean in that server has any container of apache server it doesn’t.

from espocrm-docker.

tmachyshyn avatar tmachyshyn commented on June 23, 2024

Ok, thanks.

Here is EspoCRM an example for traefik v1 with let's encrypt:

version: '3'

networks:
  http_network:
    external: true
  internal_network:
    external: false

services:

  espocrm.domain.com:
    container_name: "espocrm.domain.com"
    image: espocrm/espocrm:latest    
    volumes:
      - ./espocrm/html:/var/www/html
      - ./espocrm/logs:/var/log/apache2
    restart: always
    labels:
      - traefik.enable=true
      - traefik.frontend.rule=Host:espocrm.domain.com
      - traefik.docker.network=http_network
      - traefik.frontend.redirect.entryPoint=https
    depends_on:
      - traefik
      - mysqlserver
    networks:
      - internal_network
      - http_network

from espocrm-docker.

yahya077 avatar yahya077 commented on June 23, 2024

The sample you sent is not possible to work even in theory. Where is the environments even if it is using default variable where do you put the domain in Apache Server. If you do not specify the domain name it will throw error like 'Set the 'ServerName' directive globally to suppress this message'. The only docker image that I can not run with traefik. I put so much effort to figure out how the espocrm server work but I didn't find yet.

from espocrm-docker.

tmachyshyn avatar tmachyshyn commented on June 23, 2024

I'm very busy right now. I will try to create a configuration for Traefik v2 in 2 weeks and let you know.

from espocrm-docker.

yahya077 avatar yahya077 commented on June 23, 2024

Thank you for your response. I’m waiting for it.

from espocrm-docker.

sekjal avatar sekjal commented on June 23, 2024

I'm taking a look at this now, and will post any solutions I come up with (or if y'all have already got this configured, I'd be happy to see it!)

from espocrm-docker.

yahya077 avatar yahya077 commented on June 23, 2024

Sorry, still is an issue :/ .

from espocrm-docker.

FabPari avatar FabPari commented on June 23, 2024

Hi, no one has a solution for Espo behind Traefik?
Possibly install 2 different Espocrm and point 2 different IPs and use the same mysql?

from espocrm-docker.

yahya077 avatar yahya077 commented on June 23, 2024

Well, it worked like a charm. Thank you so much. I just change a little. I made mysql internal cause I have more than one mysql in my server.

For mysql:

    networks:
      - proxy

For espocrm

    networks:
      - espocrm
      - proxy

And I removed this line
- traefik.docker.network=traefik_public

from espocrm-docker.

FabPari avatar FabPari commented on June 23, 2024

@arkadywtf you are my good! 2 days I try to make somethink like this
I test your file with portainer stack and it work! this i a great solution.
I have last request , do you think is possible install 2 different espocrm (2 completly different installation for 2 different company with other 2 domain) that have same mysql and add phpmyadmin?
Another possibility is create another stack like this one (tomorrow I'll test)
Thanks too much
Fabio

from espocrm-docker.

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.