Skip to content
This repository was archived by the owner on Sep 23, 2021. It is now read-only.
This repository was archived by the owner on Sep 23, 2021. It is now read-only.

Write the compose using github as context #69

@delcroip

Description

@delcroip

Is your feature request related to a problem? Please describe.
with the current docker-compose, the repo need to be clone and maintained in sync when using github link in compose would simplify (almost nobody will update the Dockerfiles)

Describe the solution you'd like
See bellow (I use version 2.4 more by habit rather than technical issue)

Describe alternatives you've considered
Add BRANCH in .env and change the context in compose


version: '2.4'

services:
  # database
  glpi-dbmysql:
    build:
      context: https://github.com/flyve-mdm/docker-environment.git#${BRANCH}:/docker/mysql/
      dockerfile: Dockerfile
      args:
        MYSQL_TAG: ${MYSQL_TAG}
        MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
    container_name: Glpi-MYSQL
    hostname: glpidb
    volumes:
    # hold the persisted data
    - ./db_data:/var/lib/mysql
    ports:
    - ${HOST_SERVER_DB_PORT}:3306
  # mosquitto
  glpi-mosquitto:
    build:
      context: https://github.com/flyve-mdm/docker-environment.git#${BRANCH}:/docker/mosquitto/
      dockerfile: Dockerfile
      args:
        MOSQUITTO_TAG: ${MOSQUITTO_TAG}
    container_name: Glpi-Mosquitto
    volumes:
    # hold the persisted data
    - ./docker/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf
    ports:
    - ${HOST_SERVER_MOSQUITTO_PORT}:1883
    - ${HOST_SERVER_MOSQUITTO_PORT_TLS}:8883
  # web server
  glpi-apache:
    build:
      context: https://github.com/flyve-mdm/docker-environment.git#${BRANCH}:/docker/apache/
      dockerfile: Dockerfile
      args:
        APACHE_TAG: ${APACHE_TAG}
        HOST_SERVER_NAME: ${HOST_SERVER_NAME}
        GLPIPATH: ${GLPIPATH}
    container_name: Glpi-apache
    hostname: glpiapache
    volumes:
      # app folder
      - ./www:${GLPIPATH}:z
      - ./docker/apache/httpd.conf:/usr/local/apache2/conf/httpd.conf
      - ./docker/apache/httpd-vhosts.conf:/usr/local/apache2/conf/extra/httpd-vhosts.conf
    working_dir: ${GLPIPATH}
    ports:
      # http port
      - ${HOST_SERVER_WEB_PORT}:80
  #PHP
  glpi-php:
    cap_add:
    - NET_ADMIN
    build:
      context: https://github.com/flyve-mdm/docker-environment.git#${BRANCH}:/docker/php/
      dockerfile: Dockerfile
      args:
        PHP_TAG: ${PHP_TAG}
        GLPI_DB_NAME_TEST: ${GLPI_DB_NAME_TEST}
        GLPI_DB_NAME_UPGRADE_TEST: ${GLPI_DB_NAME_UPGRADE_TEST}
        MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
        GLPI_DB_NAME: ${GLPI_DB_NAME}
        GLPI_BRANCH: ${GLPI_BRANCH}
        GLPI_SOURCE: ${GLPI_SOURCE}
        CLONNING_METHOD: ${CLONNING_METHOD}
        GLPIPATH: ${GLPIPATH}
        DEFAULT_TIME_ZONE: ${DEFAULT_TIME_ZONE}
        FLYVEMDM_BRANCH: ${FLYVEMDM_BRANCH}
        FLYVEMDM_SOURCE: ${FLYVEMDM_SOURCE}
        FLYVEMDM_PATH: ${FLYVEMDM_PATH}
        FUSIONINVENTORY_BRANCH: ${FUSIONINVENTORY_BRANCH}
        FUSIONINVENTORY_SOURCE: ${FUSIONINVENTORY_SOURCE}
        FUSIONINVENTORY_PATH: ${FUSIONINVENTORY_PATH}
        HOST_SERVER_MOSQUITTO_PORT: ${HOST_SERVER_MOSQUITTO_PORT}
        HOST_SERVER_MOSQUITTO_PORT_TLS: ${HOST_SERVER_MOSQUITTO_PORT_TLS}
        HOST_SERVER_NAME: ${HOST_SERVER_NAME}
    container_name: Glpi-PHP
    hostname: glpiphp
    links:
      - glpi-dbmysql:dockerdb
      - glpi-mosquitto:dockerMosquitto
    command: ["/opt/dev-tools/cliinstall.sh"]
    volumes:
      - ./www:${GLPIPATH}:z
      - ./docker/php/custom.ini:/usr/local/etc/php/conf.d/custom.ini
      - ${HOST_CONFIG_SSH_PATH}:/root/.ssh:z #Your Access ssh keys
  glpi-phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: Glpi-Phpmyadmin
    hostname: glpiphpmyadmin
    links:
      - glpi-dbmysql:dockerdb
    ports:
        - ${HOST_ADMIN_DB}:80
    environment:
        PMA_USER: root
        PMA_PASSWORD: docker
        PMA_HOST: glpi-dbmysql
volumes:
  db-data: {}
  mosquitto: {}
# End of file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions