Skip to content

Commit e39b05c

Browse files
authored
Merge pull request #280 from dbarzin/dev
update Docker
2 parents 35cae5e + 8f247e8 commit e39b05c

File tree

4 files changed

+47
-41
lines changed

4 files changed

+47
-41
lines changed

Dockerfile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
FROM --platform=amd64 nginx:bookworm
1+
FROM nginx:bookworm
22

33
RUN apt update && apt dist-upgrade -y
44
RUN apt-get install -y --no-install-recommends \
5-
git=1:2.39.5-* \
6-
composer=2.5.5-* \
7-
php=2:8.2* \
8-
php-cli=2:8.2* \
5+
git \
6+
composer \
7+
php \
8+
php-cli \
99
php-opcache \
10-
php-mysql=2:8.2* \
11-
php-pgsql=2:8.2* \
12-
php-zip=2:8.2* \
13-
php-gd=2:8.2* \
14-
php-mbstring=2:8.2* \
15-
php-curl=2:8.2* \
16-
php-xml=2:8.2* \
10+
php-mysql \
11+
php-pgsql \
12+
php-zip \
13+
php-gd \
14+
php-mbstring \
15+
php-curl \
16+
php-xml \
1717
mariadb-server \
1818
cron \
1919
&& apt-get clean && rm -rf /var/lib/apt/lists/*
@@ -46,4 +46,4 @@ RUN chmod u+x /opt/entrypoint.sh
4646

4747
EXPOSE 80
4848

49-
ENTRYPOINT "/opt/entrypoint.sh"
49+
ENTRYPOINT ["/opt/entrypoint.sh"]

docker/docker-compose.yml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
11
version: "3.7"
22
services:
33
web:
4+
image: deming
5+
mysql:
6+
condition: service_healthy
47
build:
5-
context: .
6-
dockerfile: Dockerfile_web
8+
context: .
9+
dockerfile: Dockerfile_web
710
environment:
8-
### PLEASE DISABLE AFTER THE FIRST RUN FOR OPTIMIZATION PRODUCTION
9-
- DB_SLEEP=10
10-
### PLEASE DISABLE FOR PRODUCTION
11-
- USE_DEMO_DATA=1
12-
### PLEASE DISABLE FOR PRODUCTION
13-
#- RESET_DB=FR #EN OR FR
14-
### PLEASE AFTER ONE RUN DISABLE FOR OPTIMIZATION
15-
- UPLOAD_DB_ISO27001=FR #EN OR FR
16-
### PLEASE AFTER ONE RUN DISABLE FOR OPTIMIZATION
17-
- INITIAL_DB=FR #EN OR FR
18-
- TZ=Europe/Paris
11+
DB_HOST: mysql
12+
DB_DATABASE: 'deming'
13+
DB_USER: 'deming_user'
14+
DB_PASSWORD: 'demPasssword-123'
15+
DB_ROOT_PASSWORD: 'root'
16+
### PLEASE DISABLE AFTER THE FIRST RUN FOR OPTIMIZATION PRODUCTION
17+
DB_SLEEP=10
18+
### PLEASE DISABLE FOR PRODUCTION
19+
USE_DEMO_DATA=1
20+
### PLEASE DISABLE FOR PRODUCTION
21+
RESET_DB=FR #EN OR FR
22+
### PLEASE AFTER ONE RUN DISABLE FOR OPTIMIZATION
23+
UPLOAD_DB_ISO27001=FR #EN OR FR
24+
### PLEASE AFTER ONE RUN DISABLE FOR OPTIMIZATION
25+
INITIAL_DB=FR #EN OR FR
26+
TZ=Europe/Paris
1927
volumes:
20-
- ./custom/.env:/var/www/deming/.env
21-
- ./custom/custom_postfix_main.cf:/etc/postfix/main.cf
22-
- ./custom/custom_postfix_mailname:/etc/mailname
23-
- ./custom/deming.php:/var/www/deming/config/deming.php
24-
- ./custom/Kernel.php:/var/www/deming/app/Console/Kernel.php
25-
- ./custom/app.php:/var/www/deming/config/app.php
28+
- ./custom/.env:/var/www/deming/.env
29+
- ./custom/custom_postfix_main.cf:/etc/postfix/main.cf
30+
- ./custom/custom_postfix_mailname:/etc/mailname
31+
- ./custom/deming.php:/var/www/deming/config/deming.php
32+
- ./custom/Kernel.php:/var/www/deming/app/Console/Kernel.php
33+
- ./custom/app.php:/var/www/deming/config/app.php
2634
ports:
27-
- 80:80
28-
depends_on:
29-
mysql:
30-
condition: service_healthy
35+
- 8000:80
36+
3137
mysql:
3238
image: mysql:8
3339
environment:

docker/initialdb.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Définit un délai de sommeil par défaut de 10 secondes
4-
DEFAULT_SLEEP=1
4+
DEFAULT_SLEEP=1
55

66
# Vérifie si la variable d'environnement RESET_DB_SLEEP est définie
77
if [ -n "${DB_SLEEP}" ]; then
@@ -22,15 +22,15 @@ if [ "${INITIAL_DB}" = "EN" ]; then
2222
# Se déplace vers le répertoire /var/www/deming/
2323
cd /var/www/deming/
2424
# Exécute la commande
25-
php artisan migrate --seed
25+
php artisan migrate --seed --force
2626
# Exit avec le code 0 pour indiquer que le script s'est terminé avec succès
2727
exit 0
2828
fi
2929
if [ "${INITIAL_DB}" = "FR" ]; then
3030
# Se déplace vers le répertoire /var/www/deming/
3131
cd /var/www/deming/
3232
# Exécute la commande
33-
LANG=fr php artisan migrate --seed
33+
LANG=fr php artisan migrate --seed --force
3434
# Exit avec le code 0 pour indiquer que le script s'est terminé avec succès
3535
exit 0
3636
fi

docker/resetdb.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ if [ "${RESET_DB}" = "EN" ]; then
2222
# Se déplace vers le répertoire /var/www/deming/
2323
cd /var/www/deming/
2424
# Exécute la commande
25-
php artisan migrate:fresh --seed
25+
php artisan migrate:fresh --seed --force
2626
# Exit avec le code 0 pour indiquer que le script s'est terminé avec succès
2727
exit 0
2828
fi
2929
if [ "${RESET_DB}" = "FR" ]; then
3030
# Se déplace vers le répertoire /var/www/deming/
3131
cd /var/www/deming/
3232
# Exécute la commande
33-
LANG=fr php artisan migrate:fresh --seed
33+
LANG=fr php artisan migrate:fresh --seed --force
3434
# Exit avec le code 0 pour indiquer que le script s'est terminé avec succès
3535
exit 0
3636
fi

0 commit comments

Comments
 (0)