Espocrm with Traefik reverse proxy and docker-compose

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Boby
    Junior Member
    • Dec 2021
    • 1

    Espocrm with Traefik reverse proxy and docker-compose

    How can i configure espo crm with traefik. I will add my docker.compose.yml file down below.
    HTML Code:
    yml
    
    
    version: '3.8'
    
    services:
    
    mysql:
    image: mysql:8
    container_name: mysql
    restart: always
    environment:
    MYSQL_ROOT_PASSWORD: root_password
    MYSQL_DATABASE: espocrm
    MYSQL_USER: espocrm
    MYSQL_PASSWORD: database_password
    command: --default-authentication-plugin=mysql_native_password
    networks:
    - espocrm
    volumes:
    - /storage/espocrm/mysql:/var/lib/mysql
    
    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://espocrm.mydomain.com"
    networks:
    - espocrm
    - proxy
    volumes:
    - /storage/espocrm:/var/www/html
    labels:
    - "traefik.enable=true"
    - "traefik.http.routers.espocrm.rule=Host(`espocrm.mydomain.com`)"
    - "traefik.http.services.espocrm.loadbalancer.server.port=8080"
    - "traefik.http.routers.espocrm.entrypoints=websecure"
    - "traefik.http.routers.espocrm.tls=true"
    - "traefik.http.routers.espocrm.tls.certresolver=cloudflare"
    - "traefik.http.routers.espocrm.tls.domains[0].main=espocrm.mydomain.com"
    restart: always
    expose:
    - 8080
    
    espocrm-daemon:
    image: espocrm/espocrm
    container_name: espocrm-daemon
    networks:
    - espocrm
    volumes:
    - /storage/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: "ws://espocrm.mydomain.com"
    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:
    - /storage/espocrm:/var/www/html
    networks:
    - espocrm
    restart: always
    entrypoint: docker-websocket.sh
    expose:
    - 8081
    - 7777
    
    networks:
    espocrm:
    driver: bridge
    proxy:
    external:
    name: "traefik_proxy"
    
    volumes:
    mysql:
    espocrm:
Working...