Skip to content

Commit

Permalink
Merge pull request #54 from eftechcombr/update-php
Browse files Browse the repository at this point in the history
Update php
  • Loading branch information
eduardofraga authored Apr 14, 2024
2 parents 88a7591 + 5c60b30 commit bd8467a
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish-nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Docker buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish-php-fpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Docker buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
Manifest files for build and deploy the **GLPI** as Containers with Docker using docker-compose or Kubernetes.

In this versio we have deployment containers with:
- [x] alpine 3.18;
- [x] php 8.2;
- [x] nginx 1.25.3;
- [x] glpi 10.0.14;
- [x] php:8.3.6-fpm-alpine3.19;
- [x] nginx:1.25.4-alpine3.18;
- [x] eftechcombr/glpi:php-fpm-10.0.14;
- [x] eftechcombr/glpi:nginx-10.0.14.



Expand Down
3 changes: 2 additions & 1 deletion docker/_env
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ MARIADB_PORT="3306"
MARIADB_DATABASE="glpi"
MARIADB_USER="glpi"
MARIADB_PASSWORD="glpi"
MARIADB_RANDOM_ROOT_PASSWORD="1"
MARIADB_ROOT_PASSWORD="my-secret-pw"
# MARIADB_RANDOM_ROOT_PASSWORD="1"
24 changes: 19 additions & 5 deletions docker/docker-compose-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.5"
services:
mariadb:
image: mariadb:10.6
Expand All @@ -7,7 +6,16 @@ services:
- mariadb-glpi-volume:/var/lib/mysql:rw
env_file: ./.env
ports:
- 3306:3306
- 3306:3306

mariadb-timezone:
image: mariadb:10.6
restart: unless-stopped
env_file: ./.env
depends_on:
- mariadb
command: mysql -h $MARIADB_HOST -u root -p$MARIADB_ROOT_PASSWORD -e "GRANT SELECT ON \`mysql\`.\`time_zone_name\` TO 'glpi'@'%'; FLUSH PRIVILEGES; FLUSH PRIVILEGES;"

glpi-db-install:
image: eftechcombr/glpi:php-fpm-10.0.14
restart: on-failure
Expand All @@ -20,6 +28,7 @@ services:
- mariadb
command:
- /usr/local/bin/glpi-db-install.sh

glpi-verify-dir:
image: eftechcombr/glpi:php-fpm-10.0.14
restart: on-failure
Expand All @@ -32,6 +41,7 @@ services:
- glpi-db-install
command:
- /usr/local/bin/glpi-verify-dir.sh

glpi-db-configure:
image: eftechcombr/glpi:php-fpm-10.0.14
restart: on-failure
Expand All @@ -44,6 +54,7 @@ services:
- glpi-verify-dir
command:
- /usr/local/bin/glpi-db-configure.sh

php:
build: php/
image: eftechcombr/glpi:php-fpm-10.0.14
Expand All @@ -60,6 +71,7 @@ services:
- glpi-verify-dir
ports:
- "9000:9000"

nginx:
build: nginx/
image: eftechcombr/glpi:nginx-10.0.14
Expand All @@ -68,12 +80,14 @@ services:
- "8080:80"
depends_on:
- php

volumes:
glpi-marketplace:
glpi-files:
glpi-etc:
glpi-install:
mariadb-glpi-volume:
#networks:
# glpi-frontend:
# glpi-backend:

# networks:
# glpi-frontend:
# glpi-backend:
22 changes: 18 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.5"
services:
mariadb:
image: mariadb:10.6
Expand All @@ -8,6 +7,15 @@ services:
env_file: ./.env
ports:
- 3306:3306

mariadb-timezone:
image: mariadb:10.6
restart: unless-stopped
env_file: ./.env
depends_on:
- mariadb
command: mysql -h $MARIADB_HOST -u root -p$MARIADB_ROOT_PASSWORD -e "GRANT SELECT ON \`mysql\`.\`time_zone_name\` TO 'glpi'@'%'; FLUSH PRIVILEGES; FLUSH PRIVILEGES;"

glpi-db-install:
image: eftechcombr/glpi:php-fpm-10.0.14
restart: on-failure
Expand All @@ -20,6 +28,7 @@ services:
- mariadb
command:
- /usr/local/bin/glpi-db-install.sh

glpi-verify-dir:
image: eftechcombr/glpi:php-fpm-10.0.14
restart: on-failure
Expand All @@ -32,6 +41,7 @@ services:
- glpi-db-install
command:
- /usr/local/bin/glpi-verify-dir.sh

glpi-db-configure:
image: eftechcombr/glpi:php-fpm-10.0.14
restart: on-failure
Expand All @@ -44,6 +54,7 @@ services:
- glpi-verify-dir
command:
- /usr/local/bin/glpi-db-configure.sh

php:
image: eftechcombr/glpi:php-fpm-10.0.14
restart: unless-stopped
Expand All @@ -59,19 +70,22 @@ services:
- glpi-verify-dir
ports:
- "9000:9000"

nginx:
image: eftechcombr/glpi:nginx-10.0.14
restart: unless-stopped
ports:
- "8080:80"
depends_on:
- php

volumes:
glpi-marketplace:
glpi-files:
glpi-etc:
glpi-install:
mariadb-glpi-volume:
#networks:
# glpi-frontend:
# glpi-backend:

# networks:
# glpi-frontend:
# glpi-backend:
2 changes: 1 addition & 1 deletion docker/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM eftechcombr/glpi:php-fpm-10.0.14 as BUILD
#

FROM nginx:1.25.3-alpine3.18
FROM nginx:1.25.4-alpine3.18
#
COPY --from=BUILD /var/www/html /var/www/html
COPY --from=BUILD /var/lib/glpi /var/lib/glpi
Expand Down
2 changes: 1 addition & 1 deletion docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.2-fpm-alpine3.18
FROM php:8.3.6-fpm-alpine3.19

ENV VERSION 10.0.14
ENV GLPI_LANG en_US
Expand Down
1 change: 0 additions & 1 deletion docker/php/scripts/glpi-db-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ dbUpgrade () {

}


php bin/console database:check_schema_integrity || dbUpgrade
7 changes: 7 additions & 0 deletions docker/php/scripts/mariadb-timezone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh


# Requires root

mysql -h "$MARIADB_HOST" -u root -p"$MARIADB_ROOT_PASSWORD" -e \"GRANT SELECT ON \`mysql\`.\`time_zone_name\` TO 'glpi'@'%'; FLUSH PRIVILEGES; FLUSH PRIVILEGES;\""
23 changes: 23 additions & 0 deletions kubernetes/mariadb-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: batch/v1
kind: Job
metadata:
name: mariadb-timezone
namespace: glpi
spec:
template:
spec:
containers:
- image: mariadb:10.6
imagePullPolicy: IfNotPresent
name: base
command:
- sh
- -c
- "mysql -h $MARIADB_HOST -u root -p$MARIADB_ROOT_PASSWORD -e \"GRANT SELECT ON \`mysql\`.\`time_zone_name\` TO 'glpi'@'%'; FLUSH PRIVILEGES; FLUSH PRIVILEGES;\""
envFrom:
- secretRef:
name: mariadb-glpi-secret
restartPolicy: Never
backoffLimit: 5
status: {}

9 changes: 5 additions & 4 deletions kubernetes/mariadb-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ metadata:
name: mariadb-glpi-secret
namespace: glpi
data:
MYSQL_RANDOM_ROOT_PASSWORD: eWVz
MYSQL_DATABASE: Z2xwaQ==
MYSQL_USER: Z2xwaQ==
MYSQL_PASSWORD: Z2xwaQ==
MARIADB_ROOT_PASSWORD: bXktc2VjcmV0LXB3Cg==
MARIADB_DATABASE: Z2xwaQ==
MARIADB_USER: Z2xwaQ==
MARIADB_PASSWORD: Z2xwaQ==

0 comments on commit bd8467a

Please sign in to comment.