├── .github ├── dependabot.yml └── workflows │ ├── githubactions-db.yml │ ├── githubactions-dovecot.yml │ ├── githubactions-glpi-apache.yml │ ├── githubactions-memcached.yml │ ├── githubactions-openldap.yml │ ├── githubactions-php-apache.yml │ ├── githubactions-php-coverage.yml │ ├── githubactions-php.yml │ ├── githubactions-redis.yml │ ├── glpi-development-env.yml │ ├── glpi-nightly.yml │ ├── glpi.yml │ ├── plugin-builder.yml │ └── update_dockerhub_readme.yml ├── .gitignore ├── LICENSE ├── README.md ├── docs └── illustration.png ├── githubactions-db ├── Dockerfile └── files │ └── etc │ └── mysql │ └── conf.d │ └── custom.cnf ├── githubactions-dovecot ├── Dockerfile └── files │ └── etc │ └── dovecot │ ├── local.conf │ └── passwd ├── githubactions-glpi-apache └── Dockerfile ├── githubactions-memcached └── Dockerfile ├── githubactions-openldap ├── Dockerfile └── files │ └── etc │ └── openldap │ └── slapd.conf ├── githubactions-php-apache ├── Dockerfile └── files │ └── etc │ └── apache2 │ ├── ports.conf │ ├── sites-available │ └── 000-default.conf │ └── vhosts │ └── glpi-common.conf ├── githubactions-php-coverage └── Dockerfile ├── githubactions-php └── Dockerfile ├── githubactions-redis └── Dockerfile ├── glpi-development-env ├── Dockerfile └── files │ └── etc │ ├── apache2 │ ├── ports.conf │ ├── sites-available │ │ └── 000-default.conf │ └── vhosts │ │ └── glpi-common.conf │ └── php │ └── conf.d │ └── glpi.ini ├── glpi ├── Dockerfile └── files │ ├── etc │ ├── apache2 │ │ ├── conf-available │ │ │ └── zzz-glpi.conf │ │ └── sites-available │ │ │ └── 000-default.conf │ ├── cron.d │ │ └── glpi │ └── php │ │ └── conf.d │ │ └── glpi.ini │ └── opt │ └── glpi │ ├── entrypoint.sh │ ├── entrypoint │ ├── forward-logs.sh │ └── init-volumes-directories.sh │ ├── startup.sh │ └── startup │ ├── install.sh │ └── start.sh └── plugin-builder └── Dockerfile /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Ensure GitHub Actions are used in their latest version 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "monthly" 8 | -------------------------------------------------------------------------------- /.github/workflows/githubactions-db.yml: -------------------------------------------------------------------------------- 1 | name: "Github actions DB images" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/githubactions-db.yml" 9 | - "githubactions-db/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/githubactions-db.yml" 13 | - "githubactions-db/**" 14 | schedule: 15 | - cron: '0 0 * * 1' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | include: 26 | - {base-image: "mariadb", target-image: "mariadb", version: "10.4", config-dir: "/etc/mysql/conf.d"} 27 | - {base-image: "mariadb", target-image: "mariadb", version: "10.5", config-dir: "/etc/mysql/conf.d"} 28 | - {base-image: "mariadb", target-image: "mariadb", version: "10.6", config-dir: "/etc/mysql/conf.d"} 29 | - {base-image: "mariadb", target-image: "mariadb", version: "10.9", config-dir: "/etc/mysql/conf.d"} 30 | - {base-image: "mariadb", target-image: "mariadb", version: "10.10", config-dir: "/etc/mysql/conf.d"} 31 | - {base-image: "mariadb", target-image: "mariadb", version: "10.11", config-dir: "/etc/mysql/conf.d"} 32 | - {base-image: "mariadb", target-image: "mariadb", version: "11.0", config-dir: "/etc/mysql/conf.d"} 33 | - {base-image: "mariadb", target-image: "mariadb", version: "11.4", config-dir: "/etc/mysql/conf.d"} 34 | - {base-image: "mariadb", target-image: "mariadb", version: "11.8", config-dir: "/etc/mysql/conf.d"} 35 | - {base-image: "mysql", target-image: "mysql", version: "5.7", config-dir: "/etc/mysql/conf.d"} 36 | - {base-image: "mysql", target-image: "mysql", version: "8.0", config-dir: "/etc/mysql/conf.d"} 37 | - {base-image: "mysql", target-image: "mysql", version: "8.4", config-dir: "/etc/mysql/conf.d"} 38 | - {base-image: "percona/percona-server", target-image: "percona", version: "5.7", config-dir: "/etc/my.cnf.d"} 39 | - {base-image: "percona/percona-server", target-image: "percona", version: "8.0", config-dir: "/etc/my.cnf.d"} 40 | - {base-image: "percona/percona-server", target-image: "percona", version: "8.4", config-dir: "/etc/my.cnf.d"} 41 | steps: 42 | - name: "Set variables" 43 | run: | 44 | OUTPUTS="type=image" 45 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 46 | OUTPUTS="$OUTPUTS,push=true" 47 | fi 48 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 49 | - name: "Checkout" 50 | uses: "actions/checkout@v5" 51 | - name: "Set up Docker Buildx" 52 | uses: "docker/setup-buildx-action@v3" 53 | - name: "Login to DockerHub" 54 | uses: "docker/login-action@v3" 55 | with: 56 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 57 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 58 | - name: "Login to Github container registry" 59 | uses: "docker/login-action@v3" 60 | with: 61 | registry: "ghcr.io" 62 | username: "${{ secrets.GHCR_USERNAME }}" 63 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 64 | - name: "Build and push" 65 | uses: "docker/build-push-action@v6" 66 | with: 67 | build-args: | 68 | BASE_IMAGE=${{ matrix.base-image }}:${{ matrix.version }} 69 | CONFIG_DIR=${{ matrix.config-dir }} 70 | cache-from: "type=gha" 71 | cache-to: "type=gha,mode=max" 72 | context: "githubactions-db" 73 | outputs: "${{ env.OUTPUTS }}" 74 | pull: true 75 | tags: "ghcr.io/glpi-project/githubactions-${{ matrix.target-image }}:${{ matrix.version }}" 76 | -------------------------------------------------------------------------------- /.github/workflows/githubactions-dovecot.yml: -------------------------------------------------------------------------------- 1 | name: "Github actions Dovecot image" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/githubactions-dovecot.yml" 9 | - "githubactions-dovecot/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/githubactions-dovecot.yml" 13 | - "githubactions-dovecot/**" 14 | schedule: 15 | - cron: '0 0 * * 1' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | steps: 23 | - name: "Set variables" 24 | run: | 25 | OUTPUTS="type=image" 26 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 27 | OUTPUTS="$OUTPUTS,push=true" 28 | fi 29 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 30 | - name: "Checkout" 31 | uses: "actions/checkout@v5" 32 | - name: "Set up Docker Buildx" 33 | uses: "docker/setup-buildx-action@v3" 34 | - name: "Login to DockerHub" 35 | uses: "docker/login-action@v3" 36 | with: 37 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 38 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 39 | - name: "Login to Github container registry" 40 | uses: "docker/login-action@v3" 41 | with: 42 | registry: "ghcr.io" 43 | username: "${{ secrets.GHCR_USERNAME }}" 44 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 45 | - name: "Build and push" 46 | uses: "docker/build-push-action@v6" 47 | with: 48 | cache-from: "type=gha" 49 | cache-to: "type=gha,mode=max" 50 | context: "githubactions-dovecot" 51 | outputs: "${{ env.OUTPUTS }}" 52 | pull: true 53 | tags: "ghcr.io/glpi-project/githubactions-dovecot:latest" 54 | -------------------------------------------------------------------------------- /.github/workflows/githubactions-glpi-apache.yml: -------------------------------------------------------------------------------- 1 | name: "GLPI Github Actions GLPI/Apache images" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/githubactions-glpi-apache.yml" 9 | - "githubactions-glpi-apache/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/githubactions-glpi-apache.yml" 13 | - "githubactions-glpi-apache/**" 14 | schedule: 15 | - cron: '0 22 * * *' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | include: 26 | - {glpi-branch: "10.0/bugfixes", glpi-version: "10.0.x", php-version: "7.4"} 27 | - {glpi-branch: "10.0/bugfixes", glpi-version: "10.0.x", php-version: "8.0"} 28 | - {glpi-branch: "10.0/bugfixes", glpi-version: "10.0.x", php-version: "8.1"} 29 | - {glpi-branch: "10.0/bugfixes", glpi-version: "10.0.x", php-version: "8.2"} 30 | - {glpi-branch: "10.0/bugfixes", glpi-version: "10.0.x", php-version: "8.3"} 31 | - {glpi-branch: "10.0/bugfixes", glpi-version: "10.0.x", php-version: "8.4"} 32 | - {glpi-branch: "10.0/bugfixes", glpi-version: "10.0.x", php-version: "8.5"} 33 | - {glpi-branch: "11.0/bugfixes", glpi-version: "11.0.x", php-version: "8.2"} 34 | - {glpi-branch: "11.0/bugfixes", glpi-version: "11.0.x", php-version: "8.3"} 35 | - {glpi-branch: "11.0/bugfixes", glpi-version: "11.0.x", php-version: "8.4"} 36 | - {glpi-branch: "11.0/bugfixes", glpi-version: "11.0.x", php-version: "8.5"} 37 | steps: 38 | - name: "Set variables" 39 | run: | 40 | OUTPUTS="type=image" 41 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 42 | OUTPUTS="$OUTPUTS,push=true" 43 | fi 44 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 45 | - name: "Checkout" 46 | uses: "actions/checkout@v5" 47 | - name: "Set up Docker Buildx" 48 | uses: "docker/setup-buildx-action@v3" 49 | - name: "Login to DockerHub" 50 | uses: "docker/login-action@v3" 51 | with: 52 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 53 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 54 | - name: "Login to Github container registry" 55 | uses: "docker/login-action@v3" 56 | with: 57 | registry: "ghcr.io" 58 | username: "${{ secrets.GHCR_USERNAME }}" 59 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 60 | - name: "Build and push" 61 | uses: "docker/build-push-action@v6" 62 | with: 63 | build-args: | 64 | BASE_IMAGE=ghcr.io/glpi-project/githubactions-php-apache:${{ matrix.php-version }} 65 | GLPI_BRANCH=${{ matrix.glpi-branch }} 66 | no-cache: true 67 | context: "githubactions-glpi-apache" 68 | outputs: "${{ env.OUTPUTS }}" 69 | pull: true 70 | tags: "ghcr.io/glpi-project/githubactions-glpi-apache:php-${{ matrix.php-version }}-glpi-${{ matrix.glpi-version }}" 71 | -------------------------------------------------------------------------------- /.github/workflows/githubactions-memcached.yml: -------------------------------------------------------------------------------- 1 | name: "Github actions Memcached image" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/githubactions-memcached.yml" 9 | - "githubactions-memcached/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/githubactions-memcached.yml" 13 | - "githubactions-memcached/**" 14 | schedule: 15 | - cron: '0 0 * * 1' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | steps: 23 | - name: "Set variables" 24 | run: | 25 | OUTPUTS="type=image" 26 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 27 | OUTPUTS="$OUTPUTS,push=true" 28 | fi 29 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 30 | - name: "Checkout" 31 | uses: "actions/checkout@v5" 32 | - name: "Set up Docker Buildx" 33 | uses: "docker/setup-buildx-action@v3" 34 | - name: "Login to DockerHub" 35 | uses: "docker/login-action@v3" 36 | with: 37 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 38 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 39 | - name: "Login to Github container registry" 40 | uses: "docker/login-action@v3" 41 | with: 42 | registry: "ghcr.io" 43 | username: "${{ secrets.GHCR_USERNAME }}" 44 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 45 | - name: "Build and push" 46 | uses: "docker/build-push-action@v6" 47 | with: 48 | build-args: | 49 | BASE_IMAGE=memcached 50 | cache-from: "type=gha" 51 | cache-to: "type=gha,mode=max" 52 | context: "githubactions-memcached" 53 | outputs: "${{ env.OUTPUTS }}" 54 | pull: true 55 | tags: "ghcr.io/glpi-project/githubactions-memcached:latest" 56 | -------------------------------------------------------------------------------- /.github/workflows/githubactions-openldap.yml: -------------------------------------------------------------------------------- 1 | name: "Github actions Open LDAP image" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/githubactions-openldap.yml" 9 | - "githubactions-openldap/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/githubactions-openldap.yml" 13 | - "githubactions-openldap/**" 14 | schedule: 15 | - cron: '0 0 * * 1' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | steps: 23 | - name: "Set variables" 24 | run: | 25 | OUTPUTS="type=image" 26 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 27 | OUTPUTS="$OUTPUTS,push=true" 28 | fi 29 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 30 | - name: "Checkout" 31 | uses: "actions/checkout@v5" 32 | - name: "Set up Docker Buildx" 33 | uses: "docker/setup-buildx-action@v3" 34 | - name: "Login to DockerHub" 35 | uses: "docker/login-action@v3" 36 | with: 37 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 38 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 39 | - name: "Login to Github container registry" 40 | uses: "docker/login-action@v3" 41 | with: 42 | registry: "ghcr.io" 43 | username: "${{ secrets.GHCR_USERNAME }}" 44 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 45 | - name: "Build and push" 46 | uses: "docker/build-push-action@v6" 47 | with: 48 | build-args: | 49 | BASE_IMAGE=alpine 50 | cache-from: "type=gha" 51 | cache-to: "type=gha,mode=max" 52 | context: "githubactions-openldap" 53 | outputs: "${{ env.OUTPUTS }}" 54 | pull: true 55 | tags: "ghcr.io/glpi-project/githubactions-openldap:latest" 56 | -------------------------------------------------------------------------------- /.github/workflows/githubactions-php-apache.yml: -------------------------------------------------------------------------------- 1 | name: "Github actions PHP images with Apache server" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/githubactions-php-apache.yml" 9 | - "githubactions-php-apache/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/githubactions-php-apache.yml" 13 | - "githubactions-php-apache/**" 14 | schedule: 15 | - cron: '0 0 * * 1' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | include: 26 | - {base-image: "php:8.1-apache-trixie", php-version: "8.1"} 27 | - {base-image: "php:8.2-apache-trixie", php-version: "8.2"} 28 | - {base-image: "php:8.3-apache-trixie", php-version: "8.3"} 29 | - {base-image: "php:8.4-apache-trixie", php-version: "8.4"} 30 | - {base-image: "php:8.5-rc-apache-trixie", php-version: "8.5"} 31 | steps: 32 | - name: "Set variables" 33 | run: | 34 | OUTPUTS="type=image" 35 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 36 | OUTPUTS="$OUTPUTS,push=true" 37 | fi 38 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 39 | - name: "Checkout" 40 | uses: "actions/checkout@v5" 41 | - name: "Set up Docker Buildx" 42 | uses: "docker/setup-buildx-action@v3" 43 | - name: "Login to DockerHub" 44 | uses: "docker/login-action@v3" 45 | with: 46 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 47 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 48 | - name: "Login to Github container registry" 49 | uses: "docker/login-action@v3" 50 | with: 51 | registry: "ghcr.io" 52 | username: "${{ secrets.GHCR_USERNAME }}" 53 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 54 | - name: "Build and push" 55 | uses: "docker/build-push-action@v6" 56 | with: 57 | build-args: | 58 | BASE_IMAGE=${{ matrix.base-image }} 59 | cache-from: "type=gha" 60 | cache-to: "type=gha,mode=max" 61 | context: "githubactions-php-apache" 62 | outputs: "${{ env.OUTPUTS }}" 63 | pull: true 64 | tags: "ghcr.io/glpi-project/githubactions-php-apache:${{ matrix.php-version }}" 65 | -------------------------------------------------------------------------------- /.github/workflows/githubactions-php-coverage.yml: -------------------------------------------------------------------------------- 1 | name: "Github actions PHP images (with coverage tools)" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/githubactions-php-coverage.yml" 9 | - "githubactions-php-coverage/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/githubactions-php-coverage.yml" 13 | - "githubactions-php-coverage/**" 14 | schedule: 15 | - cron: '0 0 * * 1' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | php-version: 26 | - "8.1" 27 | - "8.2" 28 | - "8.3" 29 | - "8.4" 30 | - "8.5" 31 | steps: 32 | - name: "Set variables" 33 | run: | 34 | OUTPUTS="type=image" 35 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 36 | OUTPUTS="$OUTPUTS,push=true" 37 | fi 38 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 39 | - name: "Checkout" 40 | uses: "actions/checkout@v5" 41 | - name: "Set up Docker Buildx" 42 | uses: "docker/setup-buildx-action@v3" 43 | - name: "Login to DockerHub" 44 | uses: "docker/login-action@v3" 45 | with: 46 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 47 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 48 | - name: "Login to Github container registry" 49 | uses: "docker/login-action@v3" 50 | with: 51 | registry: "ghcr.io" 52 | username: "${{ secrets.GHCR_USERNAME }}" 53 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 54 | - name: "Build and push" 55 | uses: "docker/build-push-action@v6" 56 | with: 57 | build-args: | 58 | BASE_IMAGE=ghcr.io/glpi-project/githubactions-php:${{ matrix.php-version }} 59 | cache-from: "type=gha" 60 | cache-to: "type=gha,mode=max" 61 | context: "githubactions-php-coverage" 62 | outputs: "${{ env.OUTPUTS }}" 63 | pull: true 64 | tags: "ghcr.io/glpi-project/githubactions-php-coverage:${{ matrix.php-version }}" 65 | -------------------------------------------------------------------------------- /.github/workflows/githubactions-php.yml: -------------------------------------------------------------------------------- 1 | name: "Github actions PHP images" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/githubactions-php.yml" 9 | - "githubactions-php/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/githubactions-php.yml" 13 | - "githubactions-php/**" 14 | schedule: 15 | - cron: '0 0 * * 1' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | include: 26 | - {base-image: "php:8.1-fpm-trixie", php-version: "8.1"} 27 | - {base-image: "php:8.2-fpm-trixie", php-version: "8.2"} 28 | - {base-image: "php:8.3-fpm-trixie", php-version: "8.3"} 29 | - {base-image: "php:8.4-fpm-trixie", php-version: "8.4"} 30 | - {base-image: "php:8.5-rc-fpm-trixie", php-version: "8.5"} 31 | steps: 32 | - name: "Set variables" 33 | run: | 34 | OUTPUTS="type=image" 35 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 36 | OUTPUTS="$OUTPUTS,push=true" 37 | fi 38 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 39 | - name: "Checkout" 40 | uses: "actions/checkout@v5" 41 | - name: "Set up Docker Buildx" 42 | uses: "docker/setup-buildx-action@v3" 43 | - name: "Login to DockerHub" 44 | uses: "docker/login-action@v3" 45 | with: 46 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 47 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 48 | - name: "Login to Github container registry" 49 | uses: "docker/login-action@v3" 50 | with: 51 | registry: "ghcr.io" 52 | username: "${{ secrets.GHCR_USERNAME }}" 53 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 54 | - name: "Build and push" 55 | uses: "docker/build-push-action@v6" 56 | with: 57 | build-args: | 58 | BASE_IMAGE=${{ matrix.base-image }} 59 | cache-from: "type=gha" 60 | cache-to: "type=gha,mode=max" 61 | context: "githubactions-php" 62 | outputs: "${{ env.OUTPUTS }}" 63 | pull: true 64 | tags: "ghcr.io/glpi-project/githubactions-php:${{ matrix.php-version }}" 65 | -------------------------------------------------------------------------------- /.github/workflows/githubactions-redis.yml: -------------------------------------------------------------------------------- 1 | name: "Github actions Redis image" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/githubactions-redis.yml" 9 | - "githubactions-redis/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/githubactions-redis.yml" 13 | - "githubactions-redis/**" 14 | schedule: 15 | - cron: '0 0 * * 1' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | steps: 23 | - name: "Set variables" 24 | run: | 25 | OUTPUTS="type=image" 26 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 27 | OUTPUTS="$OUTPUTS,push=true" 28 | fi 29 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 30 | - name: "Checkout" 31 | uses: "actions/checkout@v5" 32 | - name: "Set up Docker Buildx" 33 | uses: "docker/setup-buildx-action@v3" 34 | - name: "Login to DockerHub" 35 | uses: "docker/login-action@v3" 36 | with: 37 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 38 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 39 | - name: "Login to Github container registry" 40 | uses: "docker/login-action@v3" 41 | with: 42 | registry: "ghcr.io" 43 | username: "${{ secrets.GHCR_USERNAME }}" 44 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 45 | - name: "Build and push" 46 | uses: "docker/build-push-action@v6" 47 | with: 48 | build-args: | 49 | BASE_IMAGE=redis 50 | cache-from: "type=gha" 51 | cache-to: "type=gha,mode=max" 52 | context: "githubactions-redis" 53 | outputs: "${{ env.OUTPUTS }}" 54 | pull: true 55 | tags: "ghcr.io/glpi-project/githubactions-redis:latest" 56 | -------------------------------------------------------------------------------- /.github/workflows/glpi-development-env.yml: -------------------------------------------------------------------------------- 1 | name: "GLPI development environment image" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/glpi-development-env.yml" 9 | - "glpi-development-env/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/glpi-development-env.yml" 13 | - "glpi-development-env/**" 14 | schedule: 15 | - cron: '0 0 * * 1' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | include: 26 | - {base-image: "php:7.4-apache-bullseye", php-version: "7.4", latest: "false"} 27 | - {base-image: "php:8.0-apache-bullseye", php-version: "8.0", latest: "false"} 28 | - {base-image: "php:8.1-apache-trixie", php-version: "8.1", latest: "false"} 29 | - {base-image: "php:8.2-apache-trixie", php-version: "8.2", latest: "false"} 30 | - {base-image: "php:8.3-apache-trixie", php-version: "8.3", latest: "false"} 31 | - {base-image: "php:8.4-apache-trixie", php-version: "8.4", latest: "true"} 32 | steps: 33 | - name: "Set variables" 34 | run: | 35 | OUTPUTS="type=image" 36 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 37 | OUTPUTS="$OUTPUTS,push=true" 38 | fi 39 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 40 | - name: "Checkout" 41 | uses: "actions/checkout@v5" 42 | - name: "Set up Docker Buildx" 43 | uses: "docker/setup-buildx-action@v3" 44 | - name: "Login to DockerHub" 45 | uses: "docker/login-action@v3" 46 | with: 47 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 48 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 49 | - name: "Login to Github container registry" 50 | uses: "docker/login-action@v3" 51 | with: 52 | registry: "ghcr.io" 53 | username: "${{ secrets.GHCR_USERNAME }}" 54 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 55 | - name: "Build and push" 56 | uses: "docker/build-push-action@v6" 57 | with: 58 | build-args: | 59 | BASE_IMAGE=${{ matrix.base-image }} 60 | cache-from: "type=gha" 61 | cache-to: "type=gha,mode=max" 62 | context: "glpi-development-env" 63 | outputs: "${{ env.OUTPUTS }}" 64 | pull: true 65 | tags: "ghcr.io/glpi-project/glpi-development-env:${{ matrix.php-version }}${{ matrix.latest == 'true' && ',ghcr.io/glpi-project/glpi-development-env:latest' || '' }}" 66 | -------------------------------------------------------------------------------- /.github/workflows/glpi-nightly.yml: -------------------------------------------------------------------------------- 1 | name: "GLPI nightly images" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/glpi-nightly.yml" 9 | - "glpi/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/glpi-nightly.yml" 13 | - "glpi/**" 14 | schedule: 15 | - cron: '0 0 * * *' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | name: "Build GLPI ${{ matrix.branch }}" 22 | runs-on: "ubuntu-latest" 23 | strategy: 24 | fail-fast: false 25 | matrix: 26 | include: 27 | - {branch: "main", tag: "dev-nightly"} 28 | - {branch: "11.0/bugfixes", tag: "11.0-nightly"} 29 | - {branch: "10.0/bugfixes", tag: "10.0-nightly"} 30 | steps: 31 | - name: "Set variables" 32 | id: "variables" 33 | run: | 34 | DESTINATIONS="type=image" 35 | if [[ "${{ github.repository }}" = 'glpi-project/docker-images' && ( "${{ github.event_name }}" = "workflow_dispatch" || "${{ github.ref }}" = 'refs/heads/main' ) ]]; then 36 | DESTINATIONS="type=registry" 37 | fi 38 | echo "destinations=$DESTINATIONS" >> $GITHUB_OUTPUT 39 | echo "tags=glpi/glpi:${{ matrix.tag }},ghcr.io/glpi-project/glpi:${{ matrix.tag }}" >> $GITHUB_OUTPUT 40 | 41 | # compute the marketplace dir 42 | MARKETPLACE_DIR="/var/glpi/marketplace" 43 | if [[ "${{ matrix.branch }}" = "10.0/bugfixes" ]]; then 44 | MARKETPLACE_DIR="/var/www/glpi/marketplace" 45 | fi 46 | echo "marketplace_dir=$MARKETPLACE_DIR" >> $GITHUB_OUTPUT 47 | - name: "Checkout" 48 | uses: "actions/checkout@v5" 49 | - name: "Get sources from glpi-project/glpi" 50 | run: | 51 | curl https://github.com/glpi-project/glpi/archive/${{ matrix.branch }}.tar.gz --location --output glpi.tar.gz 52 | mkdir glpi/sources 53 | tar --extract --ungzip --strip 1 --file glpi.tar.gz --directory glpi/sources 54 | - name: "Set up Docker Buildx" 55 | uses: "docker/setup-buildx-action@v3" 56 | - name: "Login to DockerHub" 57 | uses: "docker/login-action@v3" 58 | with: 59 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 60 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 61 | - name: "Login to Github container registry" 62 | uses: "docker/login-action@v3" 63 | with: 64 | registry: "ghcr.io" 65 | username: "${{ secrets.GHCR_USERNAME }}" 66 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 67 | - name: "Build and push" 68 | uses: "docker/build-push-action@v6" 69 | with: 70 | build-args: | 71 | BUILDER_IMAGE=php:8.4-cli-alpine 72 | APP_IMAGE=php:8.4-apache 73 | GLPI_MARKETPLACE_DIR=${{ steps.variables.outputs.marketplace_dir }} 74 | cache-from: "type=gha" 75 | cache-to: "type=gha,mode=max" 76 | context: "glpi" 77 | outputs: "${{ steps.variables.outputs.destinations }}" 78 | pull: true 79 | tags: "${{ steps.variables.outputs.tags }}" 80 | -------------------------------------------------------------------------------- /.github/workflows/glpi.yml: -------------------------------------------------------------------------------- 1 | name: "GLPI images for official releases" 2 | 3 | on: 4 | # Enable execution from another workflow 5 | workflow_call: 6 | inputs: 7 | glpi-version: 8 | required: true 9 | type: string 10 | image-suffix: 11 | required: false 12 | type: string 13 | default: "" 14 | php-version: 15 | required: false 16 | type: string 17 | default: "8.4" 18 | secrets: 19 | DOCKER_HUB_USERNAME: 20 | required: true 21 | DOCKER_HUB_TOKEN: 22 | required: true 23 | GHCR_USERNAME: 24 | required: true 25 | GHCR_ACCESS_TOKEN: 26 | required: true 27 | 28 | # Enable manual run 29 | # 30 | # It can be executed by a curl command: 31 | # 32 | # curl -X POST \ 33 | # -H "Accept: application/vnd.github.v3+json" \ 34 | # -H "Authorization: " \ 35 | # https://api.github.com/repos/glpi-project/docker-images/actions/workflows//dispatches \ 36 | # -d '{"ref":"main", "inputs": { "glpi-version":"10.0.18" }}' 37 | workflow_dispatch: 38 | inputs: 39 | glpi-version: 40 | description: "GLPI version to build, e.g. 10.0.18" 41 | required: true 42 | type: string 43 | image-suffix: 44 | description: "Suffix to add to the image name, e.g. 'nighlty'" 45 | required: false 46 | type: string 47 | default: "" 48 | php-version: 49 | description: "PHP version to use for the build" 50 | required: true 51 | type: string 52 | default: "8.4" 53 | 54 | jobs: 55 | build: 56 | name: "Build GLPI ${{ inputs.glpi-version }}" 57 | runs-on: "ubuntu-latest" 58 | steps: 59 | - name: "Set variables" 60 | id: "variables" 61 | run: | 62 | IMAGE_VERSION="$(echo '${{ inputs.glpi-version }}' | sed -E 's|/|-|')" 63 | IMAGE_VERSION_MAJOR=$(echo "${{ inputs.glpi-version }}" | cut -d. -f1) 64 | IMAGE_VERSION_MINOR=$(echo "${{ inputs.glpi-version }}" | cut -d. -f1-2) 65 | 66 | if [[ "${{ inputs.image-suffix }}" != '' ]]; then 67 | IMAGE_VERSION="$IMAGE_VERSION-${{ inputs.image-suffix }}" 68 | fi 69 | 70 | # prepare the tags to push 71 | TAGS="glpi/glpi:$IMAGE_VERSION,ghcr.io/glpi-project/glpi:$IMAGE_VERSION" 72 | 73 | PRERELEASE_FLAG="$( echo "${{ inputs.glpi-version }}" | grep -Po '(\-\w+)?$' )" 74 | if [[ -z "$PRERELEASE_FLAG" ]]; then 75 | # populate major version tags, ex 10.0.18 -> 10 76 | TAGS="$TAGS,glpi/glpi:$IMAGE_VERSION_MAJOR,ghcr.io/glpi-project/glpi:$IMAGE_VERSION_MAJOR" 77 | 78 | # populate minor version tags, ex 10.0.18 -> 10.0 79 | TAGS="$TAGS,glpi/glpi:$IMAGE_VERSION_MINOR,ghcr.io/glpi-project/glpi:$IMAGE_VERSION_MINOR" 80 | 81 | # find if the current version is the latest 82 | if [[ "${{ inputs.glpi-version }}" = "$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | jq -r .tag_name)" ]]; then 83 | TAGS="$TAGS,glpi/glpi:latest,ghcr.io/glpi-project/glpi:latest" 84 | fi 85 | fi 86 | echo "tags=$TAGS" >> $GITHUB_OUTPUT 87 | 88 | # compute the marketplace dir 89 | MARKETPLACE_DIR="/var/glpi/marketplace" 90 | if [[ "$IMAGE_VERSION_MAJOR" = "10" ]]; then 91 | MARKETPLACE_DIR="/var/www/glpi/marketplace" 92 | fi 93 | echo "marketplace_dir=$MARKETPLACE_DIR" >> $GITHUB_OUTPUT 94 | - name: "Checkout" 95 | uses: "actions/checkout@v5" 96 | with: 97 | repository: glpi-project/docker-images 98 | - name: "Get sources from glpi-project/glpi" 99 | run: | 100 | curl https://github.com/glpi-project/glpi/archive/${{ inputs.glpi-version }}.tar.gz --location --output glpi.tar.gz 101 | mkdir glpi/sources 102 | tar --extract --ungzip --strip 1 --file glpi.tar.gz --directory glpi/sources 103 | - name: "Set up Docker Buildx" 104 | uses: "docker/setup-buildx-action@v3" 105 | - name: "Login to DockerHub" 106 | uses: "docker/login-action@v3" 107 | with: 108 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 109 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 110 | - name: "Login to Github container registry" 111 | uses: "docker/login-action@v3" 112 | with: 113 | registry: "ghcr.io" 114 | username: "${{ secrets.GHCR_USERNAME }}" 115 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 116 | - name: "Build and push" 117 | uses: "docker/build-push-action@v6" 118 | with: 119 | build-args: | 120 | BUILDER_IMAGE=php:${{inputs.php-version}}-cli-alpine 121 | APP_IMAGE=php:${{inputs.php-version}}-apache 122 | GLPI_MARKETPLACE_DIR=${{ steps.variables.outputs.marketplace_dir }} 123 | cache-from: "type=gha" 124 | cache-to: "type=gha,mode=max" 125 | context: "glpi" 126 | outputs: "type=registry" 127 | pull: true 128 | tags: "${{ steps.variables.outputs.tags }}" 129 | -------------------------------------------------------------------------------- /.github/workflows/plugin-builder.yml: -------------------------------------------------------------------------------- 1 | name: "Plugin builder image" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - ".github/workflows/plugin-builder.yml" 9 | - "plugin-builder/**" 10 | pull_request: 11 | paths: 12 | - ".github/workflows/plugin-builder.yml" 13 | - "plugin-builder/**" 14 | schedule: 15 | - cron: '0 0 * * 1' 16 | # Enable manual run 17 | workflow_dispatch: 18 | 19 | jobs: 20 | build: 21 | runs-on: "ubuntu-latest" 22 | steps: 23 | - name: "Set variables" 24 | run: | 25 | OUTPUTS="type=image" 26 | if [[ "${{ github.ref }}" = 'refs/heads/main' && "${{ github.repository }}" = 'glpi-project/docker-images' ]]; then 27 | OUTPUTS="$OUTPUTS,push=true" 28 | fi 29 | echo "OUTPUTS=$OUTPUTS" >> $GITHUB_ENV 30 | - name: "Checkout" 31 | uses: "actions/checkout@v5" 32 | - name: "Set up Docker Buildx" 33 | uses: "docker/setup-buildx-action@v3" 34 | - name: "Login to DockerHub" 35 | uses: "docker/login-action@v3" 36 | with: 37 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 38 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 39 | - name: "Login to Github container registry" 40 | uses: "docker/login-action@v3" 41 | with: 42 | registry: "ghcr.io" 43 | username: "${{ secrets.GHCR_USERNAME }}" 44 | password: "${{ secrets.GHCR_ACCESS_TOKEN }}" 45 | - name: "Build and push" 46 | uses: "docker/build-push-action@v6" 47 | with: 48 | cache-from: "type=gha" 49 | cache-to: "type=gha,mode=max" 50 | context: "plugin-builder" 51 | outputs: "${{ env.OUTPUTS }}" 52 | pull: true 53 | tags: "ghcr.io/glpi-project/plugin-builder:latest" 54 | -------------------------------------------------------------------------------- /.github/workflows/update_dockerhub_readme.yml: -------------------------------------------------------------------------------- 1 | name: "Update DockerHub README" 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths: 8 | - "README.md" 9 | 10 | jobs: 11 | update-readme: 12 | runs-on: "ubuntu-latest" 13 | steps: 14 | - name: "Checkout" 15 | uses: "actions/checkout@v5" 16 | - name: "Update repository description" 17 | uses: "peter-evans/dockerhub-description@v5" 18 | with: 19 | username: "${{ secrets.DOCKER_HUB_USERNAME }}" 20 | password: "${{ secrets.DOCKER_HUB_TOKEN }}" 21 | repository: "glpi/glpi" 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | glpi/sources/ 2 | glpi-nightly/sources/ 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 GLPI 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GLPI Docker Images 2 | 3 | ![GLPI on docker illustration](https://raw.githubusercontent.com/glpi-project/docker-images/refs/heads/main/docs/illustration.png) 4 | 5 | [GLPI](https://glpi-project.org) is a free and open source Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing. 6 | 7 | A few links: 8 | 9 | - [Report an issue](https://github.com/glpi-project/glpi/issues/new?template=bug_report.yml) 10 | - [Documentation](https://glpi-project.org/documentation/) 11 | 12 | 13 | This repository contains build files for docker images available in [Github Container Registry](https://github.com/orgs/glpi-project/packages?ecosystem=container) and [Docker hub](https://hub.docker.com/r/glpi/glpi). 14 | 15 | ## How to use this image 16 | 17 | ### via [docker compose](https://github.com/docker/compose) 18 | 19 | **docker-compose.yml** 20 | ```yaml 21 | services: 22 | glpi: 23 | image: "glpi/glpi:latest" 24 | restart: "unless-stopped" 25 | volumes: 26 | - "./storage/glpi:/var/glpi:rw" 27 | env_file: .env # Pass environment variables from .env file to the container 28 | depends_on: 29 | db: 30 | condition: service_healthy 31 | ports: 32 | - "80:80" 33 | 34 | db: 35 | image: "mysql" 36 | restart: "unless-stopped" 37 | volumes: 38 | - "./storage/mysql:/var/lib/mysql" 39 | environment: 40 | MYSQL_RANDOM_ROOT_PASSWORD: "yes" 41 | MYSQL_DATABASE: ${GLPI_DB_NAME} 42 | MYSQL_USER: ${GLPI_DB_USER} 43 | MYSQL_PASSWORD: ${GLPI_DB_PASSWORD} 44 | healthcheck: 45 | test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD 46 | start_period: 5s 47 | interval: 5s 48 | timeout: 5s 49 | retries: 10 50 | expose: 51 | - "3306" 52 | ``` 53 | 54 | And an .env file: 55 | 56 | **.env** 57 | ```env 58 | GLPI_DB_HOST=db 59 | GLPI_DB_PORT=3306 60 | GLPI_DB_NAME=glpi 61 | GLPI_DB_USER=glpi 62 | GLPI_DB_PASSWORD=glpi 63 | ``` 64 | 65 | Then launch it with: 66 | 67 | ```bash 68 | docker compose up -d 69 | ``` 70 | 71 | Please note that we setup a random root password for the MySQL database, so you will need to check the logs of the `db` container to find it: 72 | 73 | ```bash 74 | docker logs 75 | ``` 76 | 77 | Once the containers are running, you can access GLPI at `http://localhost` 78 | GLPI will automatically install or update itself if needed. 79 | 80 | You can disable this behavior by setting the environment variable `GLPI_SKIP_AUTOINSTALL` to `true` in the `.env` file. Same with `GLPI_SKIP_AUTOUPDATE` to disable automatic updates. 81 | 82 | If so, when accessing the web interface, installation wizard will ask you to provide the database connection details. You can use the following credentials: 83 | 84 | - Hostname: `db` 85 | - Database: `glpi` 86 | - User: `glpi` 87 | - Password: `glpi` 88 | 89 | ### Timezones support 90 | 91 | If you want to initialize the timezones support for GLPI, we need to first GRANT the glpi user to access the `mysql.time_zone` table. So with the docker container running, you can run the following command: 92 | 93 | ```bash 94 | docker exec -it mysql -u root -p -e "GRANT SELECT ON mysql.time_zone_name TO 'glpi'@'%';FLUSH PRIVILEGES;" 95 | ``` 96 | The root password will be the one you found in the logs of the `db` container previously. 97 | 98 | Then you can run the following command to initialize the timezones on the GLPI container: 99 | 100 | ```bash 101 | docker exec -it /var/www/glpi/bin/console database:enable_timezones 102 | ``` 103 | 104 | ### Volumes 105 | 106 | By default, the `glpi/glpi` image provides a volume containing its `config`, `marketplace` and `files` directories. 107 | For GLPI 10.0.x version the marketplace directory is not declared in the volume as the path differs. You may want to create a manual volume for the path `/var/www/glpi/marketplace` if you plan to use it. 108 | -------------------------------------------------------------------------------- /docs/illustration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/docker-images/46c9847f8a967de5a549e104acadccf8965c2702/docs/illustration.png -------------------------------------------------------------------------------- /githubactions-db/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=mysql:latest 2 | 3 | FROM $BASE_IMAGE 4 | 5 | LABEL \ 6 | org.opencontainers.image.title="GLPI Github Actions database container" \ 7 | org.opencontainers.image.description="This container is used to run GLPI test suite on Github Actions." \ 8 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 9 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 10 | 11 | ARG CONFIG_DIR=/etc/mysql/conf.d 12 | COPY ./files/etc/mysql/conf.d/custom.cnf $CONFIG_DIR/custom.cnf 13 | 14 | RUN \ 15 | (test -f /usr/bin/mysql || (test -f /usr/bin/mariadb && ln -s /usr/bin/mariadb /usr/bin/mysql)) \ 16 | && (test -f /usr/bin/mysqladmin || (test -f /usr/bin/mariadb-admin && ln -s /usr/bin/mariadb-admin /usr/bin/mysqladmin)) 17 | 18 | HEALTHCHECK --interval=10s --retries=5 --timeout=5s \ 19 | CMD mysqladmin ping 20 | -------------------------------------------------------------------------------- /githubactions-db/files/etc/mysql/conf.d/custom.cnf: -------------------------------------------------------------------------------- 1 | 2 | [mysqld] 3 | # Tweak optimizer 4 | optimizer_switch='mrr=on' 5 | optimizer_switch='mrr_cost_based=off' 6 | 7 | # Mount datadir onto memory 8 | datadir=/dev/shm/mysql 9 | 10 | 11 | [mariadb] 12 | # Tweak cache/buffers 13 | join_cache_level=8 14 | join_buffer_size=8M 15 | mrr_buffer_size=8M 16 | 17 | 18 | [mysqld-8.0] 19 | # Fix "Authentication plugin 'caching_sha2_password' cannot be loaded" on MySQL 8.0 20 | default-authentication-plugin = mysql_native_password 21 | -------------------------------------------------------------------------------- /githubactions-dovecot/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:trixie-slim 2 | 3 | LABEL \ 4 | org.opencontainers.image.title="GLPI Github Actions Dovecot container" \ 5 | org.opencontainers.image.description="This container is used to run GLPI test suite on Github Actions." \ 6 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 7 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 8 | 9 | # Create glpi user and its home directory 10 | RUN groupadd --gid 1000 glpi 11 | RUN useradd --create-home --home-dir /home/glpi --gid 1000 --uid 1000 glpi 12 | RUN usermod --append --groups mail glpi 13 | 14 | RUN \ 15 | # Clean APT sources list to prevent packages list update error: 16 | # E: Could not open file /var/lib/apt/lists/deb.debian.org_debian_dists_buster_main_binary-amd64_Packages.diff_Index - open (2: No such file or directory) 17 | rm -rf /var/lib/apt/lists/* \ 18 | \ 19 | # Update APT sources list 20 | && apt-get update \ 21 | \ 22 | # Install mail server and getmail utility. 23 | && apt-get install --assume-yes --no-install-recommends --quiet dovecot-imapd dovecot-pop3d getmail6 \ 24 | && maildirmake.dovecot /home/glpi/Maildir glpi \ 25 | \ 26 | # Clean sources list. 27 | && rm -rf /var/lib/apt/lists/* 28 | 29 | COPY ./files/etc/dovecot/local.conf /etc/dovecot/local.conf 30 | COPY ./files/etc/dovecot/passwd /etc/dovecot/passwd 31 | 32 | HEALTHCHECK --interval=10s --retries=5 --timeout=5s \ 33 | CMD doveadm service status 34 | 35 | CMD ["/usr/sbin/dovecot", "-F"] 36 | -------------------------------------------------------------------------------- /githubactions-dovecot/files/etc/dovecot/local.conf: -------------------------------------------------------------------------------- 1 | auth_allow_cleartext = yes 2 | mail_driver = maildir 3 | mail_path = /home/glpi/Maildir 4 | mail_inbox_path = /home/glpi/Maildir 5 | mail_max_userip_connections = 10000 6 | 7 | passdb passwd-file { 8 | passwd_file_path = /etc/dovecot/passwd 9 | } 10 | userdb passwd-file { 11 | passwd_file_path = /etc/dovecot/passwd 12 | } 13 | -------------------------------------------------------------------------------- /githubactions-dovecot/files/etc/dovecot/passwd: -------------------------------------------------------------------------------- 1 | testuser:{plain}applesauce:1000:1000::/home/glpi:: 2 | -------------------------------------------------------------------------------- /githubactions-glpi-apache/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | 3 | FROM $BASE_IMAGE 4 | 5 | LABEL \ 6 | org.opencontainers.image.title="GLPI Github Actions PHP/Apache container for GLPI plugins" \ 7 | org.opencontainers.image.description="This container is used to run GLPI plugins test suites on Github Actions." \ 8 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 9 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 10 | 11 | ARG GLPI_BRANCH 12 | 13 | RUN \ 14 | # Get target GLPI branch source code. 15 | git clone --depth=1 --branch=$GLPI_BRANCH https://github.com/glpi-project/glpi /tmp/glpi \ 16 | && git --git-dir="/tmp/glpi/.git" checkout-index --all --force --prefix="/var/www/glpi/" \ 17 | \ 18 | # Build GLPI. 19 | && composer --working-dir=/var/www/glpi build \ 20 | \ 21 | # Clean useless files 22 | && rm -rf /tmp/glpi 23 | -------------------------------------------------------------------------------- /githubactions-memcached/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=memcached:latest 2 | 3 | FROM $BASE_IMAGE 4 | 5 | LABEL \ 6 | org.opencontainers.image.title="GLPI Github Actions Memcached container" \ 7 | org.opencontainers.image.description="This container is used to run GLPI test suite on Github Actions." \ 8 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 9 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 10 | 11 | # Install netcat for healthcheck 12 | USER root 13 | RUN apt-get update \ 14 | && apt-get install --assume-yes --no-install-recommends --quiet netcat-traditional \ 15 | && rm -rf /var/lib/apt/lists/* 16 | 17 | # Switch back to memcache user 18 | USER memcache 19 | 20 | HEALTHCHECK --interval=10s --retries=5 --timeout=5s \ 21 | CMD /bin/nc -z 127.0.0.1 11211 22 | -------------------------------------------------------------------------------- /githubactions-openldap/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=alpine 2 | 3 | FROM $BASE_IMAGE 4 | 5 | LABEL \ 6 | org.opencontainers.image.title="GLPI Github Actions OpenLDAP container" \ 7 | org.opencontainers.image.description="This container is used to run GLPI test suite on Github Actions." \ 8 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 9 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 10 | 11 | RUN \ 12 | # Update APK package list. 13 | apk update \ 14 | \ 15 | # Install openldap. 16 | && apk add openldap openldap-clients \ 17 | \ 18 | # Clean sources list. 19 | && rm -rf /var/cache/apk/* 20 | 21 | COPY ./files/etc/openldap/slapd.conf /etc/openldap/slapd.conf 22 | 23 | HEALTHCHECK --interval=10s --retries=5 --timeout=5s \ 24 | CMD ldapwhoami -x -H ldap://127.0.0.1:3890/ -D "cn=Manager,dc=glpi,dc=org" -w insecure || exit 1 25 | 26 | CMD ["/bin/sh", "-c", "ulimit -n 1024 && slapd -d 32768 -h \"ldap://0.0.0.0:3890/\""] 27 | -------------------------------------------------------------------------------- /githubactions-openldap/files/etc/openldap/slapd.conf: -------------------------------------------------------------------------------- 1 | # See slapd.conf(5) for details on configuration options. 2 | include /etc/openldap/schema/core.schema 3 | include /etc/openldap/schema/cosine.schema 4 | include /etc/openldap/schema/inetorgperson.schema 5 | include /etc/openldap/schema/nis.schema 6 | 7 | moduleload back_ldif 8 | 9 | disallow bind_anon 10 | 11 | database ldif 12 | 13 | directory /var/lib/openldap/openldap-data/ 14 | 15 | suffix "dc=glpi,dc=org" 16 | rootdn "cn=Manager,dc=glpi,dc=org" 17 | rootpw insecure 18 | -------------------------------------------------------------------------------- /githubactions-php-apache/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=php:apache-trixie 2 | 3 | 4 | ##### 5 | # Fetch composer latest build 6 | ##### 7 | FROM composer:latest AS composer 8 | 9 | ##### 10 | # Build main image 11 | ##### 12 | FROM $BASE_IMAGE 13 | 14 | LABEL \ 15 | org.opencontainers.image.title="GLPI Github Actions PHP container" \ 16 | org.opencontainers.image.description="This container is used to run GLPI test suite on Github Actions." \ 17 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 18 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 19 | 20 | RUN \ 21 | # Update package list. 22 | apt update \ 23 | \ 24 | # Install exif extension. 25 | && docker-php-ext-install exif \ 26 | \ 27 | # Install GD PHP extension. 28 | && apt install --assume-yes --no-install-recommends --quiet libfreetype6-dev libjpeg-dev libpng-dev libwebp-dev \ 29 | && docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ 30 | && docker-php-ext-install gd \ 31 | \ 32 | # Install intl PHP extension. 33 | && apt install --assume-yes --no-install-recommends --quiet libicu-dev \ 34 | && docker-php-ext-install intl \ 35 | \ 36 | # Install ldap PHP extension. 37 | && apt install --assume-yes --no-install-recommends --quiet libldap2-dev \ 38 | && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ 39 | && docker-php-ext-install ldap \ 40 | \ 41 | # Install memcached PHP extension. 42 | && apt install --assume-yes --no-install-recommends --quiet libmemcached-dev \ 43 | && pecl install memcached \ 44 | && docker-php-ext-enable memcached \ 45 | \ 46 | # Install mysqli PHP extension. 47 | && docker-php-ext-install mysqli \ 48 | \ 49 | # Install bcmath PHP extension. 50 | && docker-php-ext-install bcmath \ 51 | \ 52 | # Install pcntl PHP extension (required for composer-require-checker). 53 | && docker-php-ext-install pcntl \ 54 | \ 55 | # Install redis PHP extension. 56 | && pecl install redis \ 57 | && docker-php-ext-enable redis \ 58 | \ 59 | # Install Zip PHP extension. 60 | && apt install --assume-yes --no-install-recommends --quiet libzip-dev \ 61 | && docker-php-ext-install zip \ 62 | \ 63 | # Install XMLRPC PHP extension. 64 | # Install from Github (extension should be available on PECL but is not) 65 | && apt install --assume-yes --no-install-recommends --quiet libxml2-dev \ 66 | && mkdir -p /tmp/xmlrpc \ 67 | && (curl --fail --silent --show-error --location https://github.com/php/pecl-networking-xmlrpc/archive/0f782ffe52cebd0a65356427b7ab72d48b72d20c/xmlrpc-0f782ff.tar.gz | tar --extract --ungzip --verbose --directory="/tmp/xmlrpc" --strip 1) \ 68 | && docker-php-ext-configure /tmp/xmlrpc --with-xmlrpc \ 69 | && docker-php-ext-install /tmp/xmlrpc \ 70 | && rm -rf /tmp/xmlrpc \ 71 | \ 72 | # Install APCU PHP extension. 73 | && pecl install apcu \ 74 | && docker-php-ext-enable apcu \ 75 | && echo "apc.enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \ 76 | && echo "apc.enable_cli=1" >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \ 77 | \ 78 | # Update PHP configuration. 79 | && echo "memory_limit = 512M" >> /usr/local/etc/php/conf.d/docker-php-memory.ini \ 80 | \ 81 | # Disable sodium PHP extension (Test should validate that polyfill works). 82 | && rm /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini \ 83 | \ 84 | # Enable apache mods. 85 | && a2enmod rewrite \ 86 | \ 87 | # Install nodejs and npm. 88 | && apt install --assume-yes --no-install-recommends --quiet gnupg \ 89 | && mkdir -p /etc/apt/keyrings \ 90 | && curl --fail --silent --show-error --location https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor --output /etc/apt/keyrings/nodesource.gpg \ 91 | && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ 92 | && apt update \ 93 | && apt install --assume-yes --no-install-recommends --quiet nodejs \ 94 | \ 95 | # Install git and zip used by composer when fetching dependencies. 96 | && apt install --assume-yes --no-install-recommends --quiet git unzip \ 97 | \ 98 | # Install gettext used for translation files. 99 | && apt install --assume-yes --no-install-recommends --quiet gettext \ 100 | \ 101 | # Install Cypress dependencies 102 | && apt install --assume-yes --no-install-recommends --quiet libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb \ 103 | \ 104 | # Install Playwright dependencies 105 | && npx playwright install-deps \ 106 | \ 107 | # Install ldap utils used by plugin CI workflows. 108 | && apt install --assume-yes --no-install-recommends --quiet ldap-utils \ 109 | \ 110 | # Install acl and sudo that will be used to give correct rights in the Gihub Actions runner context. 111 | # sudo may also be usefull to temporarly install upcoming required system components. 112 | && apt install --assume-yes --no-install-recommends --quiet acl sudo \ 113 | \ 114 | # Clean sources list 115 | && rm -rf /var/lib/apt/lists/* 116 | 117 | # Copy composer binary 118 | COPY --from=composer /usr/bin/composer /usr/bin/composer 119 | 120 | # Copy files to container 121 | RUN mkdir /etc/apache2/vhosts 122 | COPY ./files/etc/apache2/ports.conf /etc/apache2/ports.conf 123 | COPY ./files/etc/apache2/vhosts/glpi-common.conf /etc/apache2/vhosts/glpi-common.conf 124 | COPY ./files/etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf 125 | 126 | RUN \ 127 | # Workaround to make apache use same UID/GID as usual host user. 128 | # It permit to prevent rights issues when executing tests from the `tests/run_tests.sh` script. 129 | groupmod --gid 1000 www-data \ 130 | && usermod --uid 1000 www-data \ 131 | \ 132 | # Allow executing commands as www-data with `sudo -l www-data` 133 | && usermod --shell /bin/bash www-data \ 134 | \ 135 | # Create home volume, to be able to share home data data across jobs. 136 | && mkdir --parents /home/www-data \ 137 | && chown www-data:www-data /home/www-data \ 138 | && usermod --home /home/www-data www-data \ 139 | \ 140 | # Create application volume. 141 | && mkdir --parents /var/www/glpi \ 142 | && chown www-data:www-data /var/www/glpi 143 | 144 | RUN \ 145 | # Create a user with UID=1001 (the UID used by Github Actions runner) and add it to sudoers. 146 | # This is mandatory to bypass rights issues during checkout and to be able to then execute scripts as www-data user. 147 | useradd -m -d /home/github-actions-runner -g www-data -u 1001 github-actions-runner \ 148 | && (echo "github-actions-runner ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/glpi) 149 | 150 | VOLUME /home/www-data 151 | VOLUME /var/www/glpi 152 | 153 | USER www-data 154 | WORKDIR /var/www/glpi 155 | 156 | # Define GLPI environment variables 157 | ENV \ 158 | GLPI_ENVIRONMENT_TYPE=testing 159 | -------------------------------------------------------------------------------- /githubactions-php-apache/files/etc/apache2/ports.conf: -------------------------------------------------------------------------------- 1 | Listen 80 2 | Listen 8090 3 | 4 | -------------------------------------------------------------------------------- /githubactions-php-apache/files/etc/apache2/sites-available/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | SetEnv GLPI_ENVIRONMENT_TYPE testing 3 | Include vhosts/glpi-common.conf 4 | 5 | 6 | 7 | SetEnv GLPI_ENVIRONMENT_TYPE e2e_testing 8 | Include vhosts/glpi-common.conf 9 | 10 | -------------------------------------------------------------------------------- /githubactions-php-apache/files/etc/apache2/vhosts/glpi-common.conf: -------------------------------------------------------------------------------- 1 | DocumentRoot /var/www/glpi/public 2 | 3 | 4 | Require all granted 5 | RewriteEngine On 6 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 7 | RewriteCond %{REQUEST_FILENAME} !-f 8 | RewriteRule ^(.*)$ index.php [QSA,L] 9 | 10 | -------------------------------------------------------------------------------- /githubactions-php-coverage/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=ghcr.io/glpi-project/githubactions-php:8.0 2 | 3 | FROM $BASE_IMAGE 4 | 5 | LABEL \ 6 | org.opencontainers.image.title="GLPI Github Actions PHP container (with code coverage tools)" \ 7 | org.opencontainers.image.description="This container is used to get code coverage from GLPI test suite on Github Actions." \ 8 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 9 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 10 | 11 | USER root 12 | 13 | RUN \ 14 | # Install pcov extension. 15 | pecl install pcov \ 16 | && docker-php-ext-enable pcov \ 17 | && echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini 18 | 19 | USER glpi 20 | -------------------------------------------------------------------------------- /githubactions-php/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=php:fpm-trixie 2 | 3 | 4 | ##### 5 | # Fetch composer latest build 6 | ##### 7 | FROM composer:latest AS composer 8 | 9 | ##### 10 | # Build main image 11 | ##### 12 | FROM $BASE_IMAGE 13 | 14 | LABEL \ 15 | org.opencontainers.image.title="GLPI Github Actions PHP container" \ 16 | org.opencontainers.image.description="This container is used to run GLPI test suite on Github Actions." \ 17 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 18 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 19 | 20 | RUN \ 21 | # Update package list. 22 | apt update \ 23 | \ 24 | # Install exif extension. 25 | && docker-php-ext-install exif \ 26 | \ 27 | # Install GD PHP extension. 28 | && apt install --assume-yes --no-install-recommends --quiet libfreetype6-dev libjpeg-dev libpng-dev libwebp-dev \ 29 | && docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ 30 | && docker-php-ext-install gd \ 31 | \ 32 | # Install intl PHP extension. 33 | && apt install --assume-yes --no-install-recommends --quiet libicu-dev \ 34 | && docker-php-ext-install intl \ 35 | \ 36 | # Install ldap PHP extension. 37 | && apt install --assume-yes --no-install-recommends --quiet libldap2-dev \ 38 | && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ 39 | && docker-php-ext-install ldap \ 40 | \ 41 | # Install memcached PHP extension. 42 | && apt install --assume-yes --no-install-recommends --quiet libmemcached-dev \ 43 | && pecl install memcached \ 44 | && docker-php-ext-enable memcached \ 45 | \ 46 | # Install mysqli PHP extension. 47 | && docker-php-ext-install mysqli \ 48 | \ 49 | # Install bcmath PHP extension. 50 | && docker-php-ext-install bcmath \ 51 | \ 52 | # Install pcntl PHP extension (required for composer-require-checker). 53 | && docker-php-ext-install pcntl \ 54 | \ 55 | # Install redis PHP extension. 56 | && pecl install redis \ 57 | && docker-php-ext-enable redis \ 58 | \ 59 | # Install Zip PHP extension. 60 | && apt install --assume-yes --no-install-recommends --quiet libzip-dev \ 61 | && docker-php-ext-install zip \ 62 | \ 63 | # Install XMLRPC PHP extension. 64 | # Install from Github (extension should be available on PECL but is not) 65 | && apt install --assume-yes --no-install-recommends --quiet libxml2-dev \ 66 | && mkdir -p /tmp/xmlrpc \ 67 | && (curl --fail --silent --show-error --location https://github.com/php/pecl-networking-xmlrpc/archive/0f782ffe52cebd0a65356427b7ab72d48b72d20c/xmlrpc-0f782ff.tar.gz | tar --extract --ungzip --verbose --directory="/tmp/xmlrpc" --strip 1) \ 68 | && docker-php-ext-configure /tmp/xmlrpc --with-xmlrpc \ 69 | && docker-php-ext-install /tmp/xmlrpc \ 70 | && rm -rf /tmp/xmlrpc \ 71 | \ 72 | # Install APCU PHP extension. 73 | && pecl install apcu \ 74 | && docker-php-ext-enable apcu \ 75 | && echo "apc.enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \ 76 | && echo "apc.enable_cli=1" >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \ 77 | \ 78 | # Update PHP configuration. 79 | && echo "memory_limit = 512M" >> /usr/local/etc/php/conf.d/docker-php-memory.ini \ 80 | \ 81 | # Disable sodium PHP extension (Test should validate that polyfill works). 82 | && rm /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini \ 83 | \ 84 | # Install nodejs and npm. 85 | && apt install --assume-yes --no-install-recommends --quiet gnupg \ 86 | && mkdir -p /etc/apt/keyrings \ 87 | && curl --fail --silent --show-error --location https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor --output /etc/apt/keyrings/nodesource.gpg \ 88 | && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ 89 | && apt update \ 90 | && apt install --assume-yes --no-install-recommends --quiet nodejs \ 91 | \ 92 | # Install git and zip used by composer when fetching dependencies. 93 | && apt install --assume-yes --no-install-recommends --quiet git unzip \ 94 | \ 95 | # Install gettext used for translation files. 96 | && apt install --assume-yes --no-install-recommends --quiet gettext \ 97 | \ 98 | # Install Cypress dependencies 99 | && apt install --assume-yes --no-install-recommends --quiet libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb \ 100 | \ 101 | # Clean sources list 102 | && rm -rf /var/lib/apt/lists/* 103 | 104 | # Copy composer binary 105 | COPY --from=composer /usr/bin/composer /usr/bin/composer 106 | 107 | # Create application volume (used to share data across jobs), 108 | # give its ownage to glpi user (1000:1000) and define it as base working dir 109 | RUN addgroup -gid 1000 glpi \ 110 | && useradd -m -d /home/glpi -g glpi -u 1000 glpi \ 111 | && mkdir -p /var/www/glpi \ 112 | && chown glpi:glpi /var/www/glpi 113 | USER glpi 114 | VOLUME /home/glpi 115 | VOLUME /var/www/glpi 116 | WORKDIR /var/www/glpi 117 | 118 | # Define GLPI environment variables 119 | ENV \ 120 | GLPI_ENVIRONMENT_TYPE=testing 121 | -------------------------------------------------------------------------------- /githubactions-redis/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=redis:latest 2 | 3 | FROM $BASE_IMAGE 4 | 5 | LABEL \ 6 | org.opencontainers.image.title="GLPI Github Actions Redis container" \ 7 | org.opencontainers.image.description="This container is used to run GLPI test suite on Github Actions." \ 8 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 9 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 10 | 11 | HEALTHCHECK --interval=10s --retries=5 --timeout=5s \ 12 | CMD redis-cli ping 13 | -------------------------------------------------------------------------------- /glpi-development-env/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE=php:apache-trixie 2 | 3 | 4 | ##### 5 | # Fetch composer latest build 6 | ##### 7 | FROM composer:latest AS composer 8 | 9 | ##### 10 | # Build main image 11 | ##### 12 | FROM $BASE_IMAGE 13 | 14 | LABEL \ 15 | org.opencontainers.image.title="GLPI development environment" \ 16 | org.opencontainers.image.description="This container can be used to serve GLPI in a development environment." \ 17 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 18 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 19 | 20 | RUN apt update \ 21 | && PHP_MAJOR_VERSION="$(echo $PHP_VERSION | cut -d '.' -f 1)" \ 22 | \ 23 | # Install bz2 extension (for marketplace). 24 | && apt install --assume-yes --no-install-recommends --quiet libbz2-dev \ 25 | && docker-php-ext-install bz2 \ 26 | \ 27 | # Install exif extension. 28 | && docker-php-ext-install exif \ 29 | \ 30 | # Install GD PHP extension. 31 | && apt install --assume-yes --no-install-recommends --quiet libfreetype6-dev libjpeg-dev libpng-dev libwebp-dev \ 32 | && docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ 33 | && docker-php-ext-install gd \ 34 | \ 35 | # Install intl PHP extension. 36 | && apt install --assume-yes --no-install-recommends --quiet libicu-dev \ 37 | && docker-php-ext-install intl \ 38 | \ 39 | # Install ldap PHP extension. 40 | && apt install --assume-yes --no-install-recommends --quiet libldap2-dev \ 41 | && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ 42 | && docker-php-ext-install ldap \ 43 | \ 44 | # Install memcached PHP extension. 45 | && apt install --assume-yes --no-install-recommends --quiet libmemcached-dev \ 46 | && pecl install memcached \ 47 | && docker-php-ext-enable memcached \ 48 | \ 49 | # Install mysqli PHP extension. 50 | && docker-php-ext-install mysqli \ 51 | \ 52 | # Install bcmath PHP extension. 53 | && docker-php-ext-install bcmath \ 54 | \ 55 | # Install opcache PHP extension. 56 | && docker-php-ext-install opcache \ 57 | \ 58 | # Install pcntl PHP extension (required for composer-require-checker). 59 | && docker-php-ext-install pcntl \ 60 | \ 61 | # Install redis PHP extension. 62 | && pecl install redis \ 63 | && docker-php-ext-enable redis \ 64 | \ 65 | # Install Zip PHP extension. 66 | && apt install --assume-yes --no-install-recommends --quiet libzip-dev \ 67 | && docker-php-ext-install zip \ 68 | \ 69 | # Install xdebug PHP extension. 70 | && if [ $PHP_MAJOR_VERSION -lt "8" ]; then \ 71 | pecl install xdebug-3.1.6 \ 72 | ; else \ 73 | pecl install xdebug \ 74 | ; fi \ 75 | && docker-php-ext-enable xdebug \ 76 | \ 77 | # Install XMLRPC PHP extension. 78 | && apt install --assume-yes --no-install-recommends --quiet libxml2-dev \ 79 | && if [ $PHP_MAJOR_VERSION -lt "8" ]; then \ 80 | # For PHP < 8.x, install bundled extension 81 | docker-php-ext-install xmlrpc \ 82 | ; else \ 83 | # For PHP 8+, install from Github (extension should be available on PECL but is not) 84 | mkdir -p /tmp/xmlrpc \ 85 | && (curl --fail --silent --show-error --location https://github.com/php/pecl-networking-xmlrpc/archive/0f782ffe52cebd0a65356427b7ab72d48b72d20c/xmlrpc-0f782ff.tar.gz | tar --extract --ungzip --verbose --directory="/tmp/xmlrpc" --strip 1) \ 86 | && docker-php-ext-configure /tmp/xmlrpc --with-xmlrpc \ 87 | && docker-php-ext-install /tmp/xmlrpc \ 88 | && rm -rf /tmp/xmlrpc \ 89 | ; fi \ 90 | \ 91 | # Enable apache mods. 92 | && a2enmod rewrite \ 93 | \ 94 | # Install nodejs and npm. 95 | && apt install --assume-yes --no-install-recommends --quiet gnupg \ 96 | && mkdir -p /etc/apt/keyrings \ 97 | && curl --fail --silent --show-error --location https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor --output /etc/apt/keyrings/nodesource.gpg \ 98 | && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ 99 | && apt update \ 100 | && apt install --assume-yes --no-install-recommends --quiet nodejs \ 101 | \ 102 | # Install git and zip used by composer when fetching dependencies. 103 | && apt install --assume-yes --no-install-recommends --quiet git unzip \ 104 | \ 105 | # Install gettext used for translation files. 106 | && apt install --assume-yes --no-install-recommends --quiet gettext \ 107 | \ 108 | # Install Cypress dependencies 109 | && apt install --assume-yes --no-install-recommends --quiet libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb \ 110 | \ 111 | # Install dependencies for plugin release tool 112 | && apt install --assume-yes --no-install-recommends --quiet gpg python3 python3-git python3-gitdb python3-github python3-lxml python3-termcolor \ 113 | && ln -s /usr/bin/python3 /usr/bin/python \ 114 | \ 115 | # Install transifex client 116 | && (cd /usr/local/bin/ && curl --silent --location https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash) \ 117 | \ 118 | # Install misc util packages commonly used by developers 119 | && apt install --assume-yes --no-install-recommends --quiet htop nano sudo vim zsh \ 120 | \ 121 | # Clean sources list 122 | && rm -rf /var/lib/apt/lists/* 123 | 124 | # Copy composer binary 125 | COPY --from=composer /usr/bin/composer /usr/bin/composer 126 | 127 | # Copy default PHP development configuration 128 | RUN cp "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" 129 | 130 | # Copy files to container. 131 | RUN mkdir /etc/apache2/vhosts 132 | COPY ./files/etc/apache2/ports.conf /etc/apache2/ports.conf 133 | COPY ./files/etc/apache2/vhosts/glpi-common.conf /etc/apache2/vhosts/glpi-common.conf 134 | COPY ./files/etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf 135 | COPY ./files/etc/php/conf.d/glpi.ini $PHP_INI_DIR/conf.d/glpi.ini 136 | 137 | # Define GLPI environment variables 138 | ENV \ 139 | GLPI_ENVIRONMENT_TYPE=development 140 | 141 | USER www-data 142 | WORKDIR /var/www/glpi 143 | -------------------------------------------------------------------------------- /glpi-development-env/files/etc/apache2/ports.conf: -------------------------------------------------------------------------------- 1 | Listen 80 2 | Listen 8080 3 | Listen 8090 4 | -------------------------------------------------------------------------------- /glpi-development-env/files/etc/apache2/sites-available/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | SetEnv GLPI_ENVIRONMENT_TYPE development 3 | 4 | Include vhosts/glpi-common.conf 5 | 6 | 7 | 8 | SetEnv GLPI_ENVIRONMENT_TYPE testing 9 | 10 | Include vhosts/glpi-common.conf 11 | 12 | 13 | 14 | SetEnv GLPI_ENVIRONMENT_TYPE e2e_testing 15 | 16 | Include vhosts/glpi-common.conf 17 | 18 | -------------------------------------------------------------------------------- /glpi-development-env/files/etc/apache2/vhosts/glpi-common.conf: -------------------------------------------------------------------------------- 1 | DocumentRoot /var/www/glpi/public 2 | 3 | ErrorLog ${APACHE_LOG_DIR}/error.log 4 | CustomLog ${APACHE_LOG_DIR}/access.log combined 5 | 6 | 7 | Require all granted 8 | 9 | RewriteEngine On 10 | 11 | # Prevent bearer authorization token filtering 12 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 13 | 14 | # Redirect all requests to GLPI router, unless file exists. 15 | RewriteCond %{REQUEST_FILENAME} !-f 16 | RewriteRule ^(.*)$ index.php [QSA,L] 17 | 18 | -------------------------------------------------------------------------------- /glpi-development-env/files/etc/php/conf.d/glpi.ini: -------------------------------------------------------------------------------- 1 | 2 | ; Session cookies security 3 | session.cookie_httponly = on 4 | 5 | [xdebug] 6 | xdebug.mode=develop,debug 7 | xdebug.start_with_request=trigger 8 | xdebug.client_host=host.docker.internal 9 | -------------------------------------------------------------------------------- /glpi/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | ARG BUILDER_IMAGE=php:cli-alpine 3 | ARG APP_IMAGE=php:apache 4 | 5 | ##### 6 | # Builder image 7 | ##### 8 | FROM $BUILDER_IMAGE AS builder 9 | 10 | # Copy composer binary from latest composer image. 11 | COPY --from=composer:latest /usr/bin/composer /usr/bin/composer 12 | 13 | # Install required system packages. 14 | RUN \ 15 | # Update APK package list. 16 | apk update \ 17 | \ 18 | # Install bash that is used in for build script. 19 | && apk add bash \ 20 | \ 21 | # Install patch utility that may be usefull to patch dependencies. 22 | && apk add patch \ 23 | \ 24 | # Install gettext and perl required to compile locales. 25 | && apk add gettext perl \ 26 | \ 27 | # Install nodejs and npm. 28 | && apk add nodejs npm \ 29 | \ 30 | # Install git and zip used by composer when fetching dependencies. 31 | && apk add git unzip \ 32 | \ 33 | # Install intl PHP extension required to execute the GLPI console. 34 | && apk add icu-dev \ 35 | && docker-php-ext-configure intl \ 36 | && docker-php-ext-install intl \ 37 | \ 38 | # Clean sources list. 39 | && rm -rf /var/cache/apk/* 40 | 41 | # Update PHP configuration. 42 | RUN echo "memory_limit = 512M" >> /usr/local/etc/php/conf.d/docker-php-memory.ini 43 | 44 | # Copy GLPI source. 45 | COPY --chown=www-data:www-data ./sources /usr/src/glpi 46 | 47 | # Build GLPI app 48 | USER www-data 49 | RUN /usr/src/glpi/tools/build_glpi.sh 50 | 51 | 52 | ##### 53 | # Application image 54 | ##### 55 | FROM $APP_IMAGE 56 | 57 | ARG GLPI_MARKETPLACE_DIR=/var/glpi/marketplace 58 | 59 | LABEL \ 60 | org.opencontainers.image.title="GLPI nightly build" \ 61 | org.opencontainers.image.description="This container contains Apache/PHP and a nightly build of GLPI. \ 62 | It can be used to test latest features and bug fixes." \ 63 | org.opencontainers.image.url="https://github.com/glpi-project/docker-images" \ 64 | org.opencontainers.image.source="git@github.com:glpi-project/docker-images" 65 | 66 | RUN apt-get update \ 67 | \ 68 | # Install APCU PHP extension. 69 | && pecl install apcu \ 70 | && docker-php-ext-enable apcu \ 71 | && echo "apc.enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \ 72 | \ 73 | # Install bz2 PHP extension. 74 | && apt-get install --assume-yes --no-install-recommends --quiet libbz2-dev \ 75 | && docker-php-ext-install bz2 \ 76 | \ 77 | # Install exif extension. 78 | && docker-php-ext-install exif \ 79 | \ 80 | # Install gd PHP extension. 81 | && apt-get install --assume-yes --no-install-recommends --quiet libfreetype6-dev libjpeg-dev libpng-dev \ 82 | && docker-php-ext-configure gd --with-freetype --with-jpeg \ 83 | && docker-php-ext-install gd \ 84 | \ 85 | # Install intl PHP extension. 86 | && apt-get install --assume-yes --no-install-recommends --quiet libicu-dev \ 87 | && docker-php-ext-configure intl \ 88 | && docker-php-ext-install intl \ 89 | \ 90 | # Install ldap PHP extension. 91 | && apt-get install --assume-yes --no-install-recommends --quiet libldap2-dev \ 92 | && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ 93 | && docker-php-ext-install ldap \ 94 | \ 95 | # Install mysqli PHP extension. 96 | && docker-php-ext-install mysqli \ 97 | \ 98 | # Install bcmath PHP extension. 99 | && docker-php-ext-install bcmath \ 100 | \ 101 | # Install opcache PHP extension. 102 | && docker-php-ext-install opcache \ 103 | \ 104 | # Install Redis PHP extension. 105 | && pecl install redis \ 106 | && docker-php-ext-enable redis \ 107 | \ 108 | # Install soap PHP extension (required for some plugins). 109 | && apt-get install --assume-yes --no-install-recommends --quiet libxml2-dev \ 110 | && docker-php-ext-install soap \ 111 | \ 112 | # Install zip PHP extension. 113 | && apt-get install --assume-yes --no-install-recommends --quiet libzip-dev \ 114 | && docker-php-ext-configure zip \ 115 | && docker-php-ext-install zip \ 116 | \ 117 | # Enable apache mods. 118 | && a2enmod rewrite \ 119 | \ 120 | # Install cron service. 121 | && apt-get install --assume-yes --no-install-recommends --quiet cron \ 122 | \ 123 | # Install acl to manage acl of writable directories. 124 | && apt-get install --assume-yes --no-install-recommends --quiet acl \ 125 | \ 126 | # install mysql client 127 | && apt-get install --assume-yes --no-install-recommends --quiet default-mysql-client \ 128 | \ 129 | # Clean sources list. 130 | && rm -rf /var/lib/apt/lists/* 131 | 132 | # Use the default production configuration 133 | # ref: https://github.com/docker-library/docs/tree/master/php#configuration 134 | RUN ln -s $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini 135 | 136 | # Copy services configuration files and startup script to container. 137 | COPY ./files/etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf 138 | COPY ./files/etc/apache2/conf-available/zzz-glpi.conf /etc/apache2/conf-available/zzz-glpi.conf 139 | COPY ./files/etc/cron.d/glpi /etc/cron.d/glpi 140 | COPY ./files/etc/php/conf.d/glpi.ini $PHP_INI_DIR/conf.d/glpi.ini 141 | COPY ./files/opt/glpi/ /opt/glpi/ 142 | RUN find /opt/glpi -type f -iname "*.sh" -exec chmod u+x {} \; 143 | 144 | # Enable custom Apache configuration 145 | RUN a2enconf zzz-glpi.conf 146 | 147 | # Install GLPI crontab. 148 | RUN crontab -u root /etc/cron.d/glpi 149 | 150 | # Copy GLPI application. 151 | COPY --from=builder --chown=www-data:www-data /usr/src/glpi /var/www/glpi 152 | 153 | # Declare a volume for "config", "marketplace" and "files" directory 154 | RUN mkdir /var/glpi && chown www-data:www-data /var/glpi 155 | VOLUME /var/glpi 156 | 157 | # Define GLPI environment variables 158 | ENV \ 159 | GLPI_INSTALL_MODE=DOCKER \ 160 | GLPI_CONFIG_DIR=/var/glpi/config \ 161 | GLPI_MARKETPLACE_DIR=${GLPI_MARKETPLACE_DIR} \ 162 | GLPI_VAR_DIR=/var/glpi/files \ 163 | GLPI_LOG_DIR=/var/glpi/logs \ 164 | GLPI_SKIP_AUTOINSTALL=false \ 165 | GLPI_SKIP_AUTOUPDATE=false 166 | 167 | # Copy the env variables to `/etc/environment`, to make them available for the commands executed by the cron service 168 | RUN printenv > /etc/environment 169 | 170 | # Define entrypoint and default command. 171 | ENTRYPOINT ["/opt/glpi/entrypoint.sh"] 172 | CMD ["/opt/glpi/startup.sh"] 173 | 174 | # Define application path as base working dir. 175 | WORKDIR /var/www/glpi 176 | -------------------------------------------------------------------------------- /glpi/files/etc/apache2/conf-available/zzz-glpi.conf: -------------------------------------------------------------------------------- 1 | 2 | # This config file contains all custom Apache settings for GLPI 3 | 4 | ServerName localhost 5 | 6 | ############################################################### 7 | # Security # 8 | ############################################################### 9 | # Harden Apache against fingerprinting 10 | ServerTokens Prod 11 | ServerSignature Off 12 | -------------------------------------------------------------------------------- /glpi/files/etc/apache2/sites-available/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | DocumentRoot /var/www/glpi/public 3 | 4 | ErrorLog ${APACHE_LOG_DIR}/error.log 5 | CustomLog ${APACHE_LOG_DIR}/access.log combined 6 | 7 | 8 | Require all granted 9 | 10 | RewriteEngine On 11 | 12 | # Prevent bearer authorization token filtering 13 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 14 | 15 | # Redirect all requests to GLPI router, unless file exists. 16 | RewriteCond %{REQUEST_FILENAME} !-f 17 | RewriteRule ^(.*)$ index.php [QSA,L] 18 | 19 | 20 | -------------------------------------------------------------------------------- /glpi/files/etc/cron.d/glpi: -------------------------------------------------------------------------------- 1 | * * * * * su www-data -s /usr/local/bin/php /var/www/glpi/front/cron.php 2>> /var/log/cron-errors.log 1>> /var/log/cron-output.log 2 | -------------------------------------------------------------------------------- /glpi/files/etc/php/conf.d/glpi.ini: -------------------------------------------------------------------------------- 1 | 2 | ; Session cookies security 3 | session.cookie_httponly = on 4 | session.cookie_samesite = "Strict" 5 | 6 | ; Do not expose PHP version 7 | expose_php = off 8 | -------------------------------------------------------------------------------- /glpi/files/opt/glpi/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -u -o pipefail 3 | 4 | /opt/glpi/entrypoint/init-volumes-directories.sh 5 | /opt/glpi/entrypoint/forward-logs.sh 6 | 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /glpi/files/opt/glpi/entrypoint/forward-logs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -u -o pipefail 3 | 4 | # Create GLPI log files if they do not exist, set rights for www-data user 5 | # and forward them to stdout/stderr (see https://stackoverflow.com/a/63713129). 6 | info_logs=( 7 | "${GLPI_LOG_DIR}/event.log" 8 | "${GLPI_LOG_DIR}/cron.log" 9 | "${GLPI_LOG_DIR}/mail.log" 10 | ) 11 | error_logs=( 12 | "${GLPI_LOG_DIR}/php-errors.log" 13 | "${GLPI_LOG_DIR}/sql-errors.log" 14 | "${GLPI_LOG_DIR}/mail-errors.log" 15 | "${GLPI_LOG_DIR}/access-errors.log" 16 | ) 17 | all_logs=( 18 | "${info_logs[@]}" 19 | "${error_logs[@]}" 20 | ) 21 | for log in "${all_logs[@]}" 22 | do 23 | if [ ! -f "$log" ]; 24 | then 25 | touch "$log" 26 | chown www-data:www-data "$log" 27 | chmod u+rw "$log" 28 | fi 29 | done 30 | 31 | # info log files to stdout 32 | for log in "${info_logs[@]}" 33 | do 34 | tail -F "$log" > /proc/1/fd/1 & 35 | done 36 | 37 | # error log files to stderr 38 | for log in "${error_logs[@]}" 39 | do 40 | tail -F "$log" > /proc/1/fd/2 & 41 | done 42 | 43 | 44 | # Forward GLPI cron logs to stdout/stderr (see https://stackoverflow.com/a/63713129). 45 | touch /var/log/cron-output.log 46 | touch /var/log/cron-errors.log 47 | tail -F /var/log/cron-output.log > /proc/1/fd/1 & 48 | tail -F /var/log/cron-errors.log > /proc/1/fd/2 & 49 | -------------------------------------------------------------------------------- /glpi/files/opt/glpi/entrypoint/init-volumes-directories.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -u -o pipefail 3 | 4 | # Create `config`, `marketplace` and `files` volume (sub)directories that are missing 5 | # and set ACL for www-data user 6 | dirs=( 7 | "${GLPI_CONFIG_DIR}" 8 | "${GLPI_VAR_DIR}" 9 | "${GLPI_VAR_DIR}/_cache" 10 | "${GLPI_VAR_DIR}/_cron" 11 | "${GLPI_VAR_DIR}/_dumps" 12 | "${GLPI_VAR_DIR}/_graphs" 13 | "${GLPI_VAR_DIR}/_locales" 14 | "${GLPI_VAR_DIR}/_lock" 15 | "${GLPI_VAR_DIR}/_pictures" 16 | "${GLPI_VAR_DIR}/_plugins" 17 | "${GLPI_VAR_DIR}/_rss" 18 | "${GLPI_VAR_DIR}/_sessions" 19 | "${GLPI_VAR_DIR}/_tmp" 20 | "${GLPI_VAR_DIR}/_uploads" 21 | "${GLPI_VAR_DIR}/_inventories" 22 | "${GLPI_MARKETPLACE_DIR}" 23 | "${GLPI_LOG_DIR}" 24 | ) 25 | for dir in "${dirs[@]}" 26 | do 27 | if [ ! -d "$dir" ] 28 | then 29 | echo "Creating $dir..." 30 | mkdir "$dir" 31 | fi 32 | echo "Setting $dir ACLs..." 33 | chown -R www-data:www-data "$dir" 34 | chmod u+rwx "$dir" 35 | find "$dir" -type d -exec chmod u+rwx {} \; 36 | find "$dir" -type f -exec chmod u+rw {} \; 37 | done 38 | -------------------------------------------------------------------------------- /glpi/files/opt/glpi/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -u -o pipefail 3 | 4 | /opt/glpi/startup/install.sh 5 | /opt/glpi/startup/start.sh 6 | -------------------------------------------------------------------------------- /glpi/files/opt/glpi/startup/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -u -o pipefail 3 | 4 | Install_GLPI() { 5 | su www-data -s /bin/bash -c 'bin/console database:install \ 6 | --db-host="$GLPI_DB_HOST" \ 7 | --db-port="$GLPI_DB_PORT" \ 8 | --db-name="$GLPI_DB_NAME" \ 9 | --db-user="$GLPI_DB_USER" \ 10 | --db-password="$GLPI_DB_PASSWORD" \ 11 | --no-interaction --quiet' 12 | } 13 | 14 | greetings() { 15 | local new_installation="$1" 16 | 17 | echo $'\n\n================================================================' 18 | echo $'Welcome to\n' 19 | echo $' ██████╗ ██╗ ██████╗ ██╗' 20 | echo $'██╔════╝ ██║ ██╔══██╗██║' 21 | echo $'██║ ███╗██║ ██████╔╝██║' 22 | echo $'██║ ██║██║ ██╔═══╝ ██║' 23 | echo $'╚██████╔╝███████╗██║ ██║' 24 | echo $' ╚═════╝ ╚══════╝╚═╝ ╚═╝\n' 25 | 26 | echo $'https://glpi-project.org' 27 | 28 | if [ "$new_installation" = true ]; then 29 | echo $'\n================================================================' 30 | echo $'GLPI installation completed successfully!\n' 31 | echo $'Please access GLPI via your web browser to complete the setup.' 32 | echo $'You can use the following credentials:\n' 33 | echo $'- Username: glpi' 34 | echo $'- Password: glpi' 35 | echo $'================================================================\n' 36 | fi 37 | } 38 | 39 | Update_GLPI() { 40 | su www-data -s /bin/bash -c 'bin/console database:update --no-interaction --quiet' 41 | } 42 | 43 | GLPI_Installed() { 44 | if [ -f "${GLPI_CONFIG_DIR}/config_db.php" ]; then 45 | su www-data -s /bin/bash -c 'bin/console db:check --quiet' 46 | # GLPI error code for db:check command: 47 | # 0: Everything is ok 48 | # 1-4: Warnings related to sql diffs (not critical) 49 | # 5: Database connection error 50 | # 6: version cannot be found 51 | # 7: no tables found 52 | # if the command above return an error below 5, GLPI is ok and we can return 0 53 | if [ $? -lt 5 ]; then 54 | return 0 55 | fi 56 | fi 57 | 58 | # If the config_db.php file does not exist or there is something wrong with the database, 59 | # GLPI is not installed 60 | return 1 61 | } 62 | 63 | if ! GLPI_Installed; then 64 | if ! $GLPI_SKIP_AUTOINSTALL; then 65 | echo "GLPI is not installed. but auto-install is enabled. Starting installation." 66 | echo "Please wait until you see the greeting, this may take a minute..." 67 | Install_GLPI 68 | greetings true 69 | fi 70 | else 71 | if ! $GLPI_SKIP_AUTOUPDATE; then 72 | echo "GLPI is installed, and auto-update is enabled. Starting update..." 73 | Update_GLPI 74 | greetings false 75 | fi 76 | fi 77 | -------------------------------------------------------------------------------- /glpi/files/opt/glpi/startup/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -u -o pipefail 3 | 4 | # Run cron service. 5 | cron 6 | 7 | # Run command previously defined in base php-apache Dockerfile. 8 | apache2-foreground 9 | -------------------------------------------------------------------------------- /plugin-builder/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:cli-alpine3.17 2 | 3 | # Copy composer binary from latest composer image. 4 | COPY --from=composer:latest /usr/bin/composer /usr/bin/composer 5 | 6 | RUN \ 7 | # Update APK package list. 8 | apk update \ 9 | \ 10 | # Install build dependencies. 11 | && apk add --virtual .build-deps build-base \ 12 | \ 13 | # Install nodejs and npm required for some plugin's dependencies. 14 | && apk add nodejs npm \ 15 | \ 16 | # Install Python, pip and Python modules required by "plugin-release" script. 17 | && apk add python3-dev \ 18 | && apk add py3-pip \ 19 | && apk add libffi-dev libxml2-dev libxslt-dev && pip install lxml \ 20 | && apk add git && pip install gitpython \ 21 | && pip install PyGithub \ 22 | && pip install termcolor \ 23 | \ 24 | # Install gettext required to build locale files. 25 | && apk add gettext \ 26 | \ 27 | # Install patch utility that may be usefull to patch dependencies. 28 | && apk add patch \ 29 | \ 30 | # Remove build dependencies. 31 | && apk del -f .build-deps \ 32 | \ 33 | # Clean sources list. 34 | && rm -rf /var/cache/apk/* 35 | 36 | # Reset entrypoint and default command. 37 | ENTRYPOINT ["/bin/sh"] 38 | CMD ["/bin/sh"] 39 | --------------------------------------------------------------------------------