Skip to content

Commit 9282cea

Browse files
authored
Merge pull request #283 from dbarzin/dev
reverse changes
2 parents bdaec2a + 8eed3d5 commit 9282cea

File tree

2 files changed

+60
-73
lines changed

2 files changed

+60
-73
lines changed

Dockerfile

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,49 @@
1-
FROM php:8.2-fpm
2-
3-
# Installer les extensions PHP nécessaires
4-
RUN apt-get update && apt-get install -y \
5-
git \
1+
FROM --platform=amd64 nginx:bookworm
2+
3+
RUN apt update && apt dist-upgrade -y
4+
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* \
9+
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* \
17+
mariadb-server \
618
cron \
7-
nginx \
8-
php-mysql \
9-
php-pgsql \
10-
php-zip \
11-
php-gd \
12-
php-mbstring \
13-
php-curl \
14-
php-xml \
1519
&& apt-get clean && rm -rf /var/lib/apt/lists/*
1620

17-
# Installer Composer
18-
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
21+
RUN touch /etc/mailname
22+
RUN echo "sender@yourdomain.org" > /etc/mailname
23+
RUN echo "* * * * * root cd /var/www/deming && php artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab
24+
RUN useradd -ms /bin/bash deming
25+
RUN mkdir -p /var/www/deming
1926

20-
# Définir le répertoire de travail
2127
WORKDIR /var/www/deming
2228

23-
# Cloner le dépôt Git
2429
RUN git clone https://www.github.com/dbarzin/deming .
25-
26-
# Copier les fichiers de configuration
27-
COPY docker/deming.conf /etc/nginx/conf.d/default.conf
28-
COPY docker/userdemo.sh /etc/userdemo.sh
30+
RUN cp docker/deming.conf /etc/nginx/conf.d/default.conf
31+
RUN cp docker/userdemo.sh /etc/userdemo.sh
2932
COPY docker/resetdb.sh /etc/resetdb.sh
30-
COPY docker/uploadiso27001db.sh /etc/uploadiso27001db.sh
33+
RUN cp docker/uploadiso27001db.sh /etc/uploadiso27001db.sh
3134
COPY docker/initialdb.sh /etc/initialdb.sh
32-
COPY docker/entrypoint.sh /opt/entrypoint.sh
33-
34-
# Rendre les scripts exécutables
35-
RUN chmod +x /etc/*.sh /opt/entrypoint.sh
36-
37-
# Configurer les permissions
38-
RUN mkdir -p storage/framework/views storage/framework/cache storage/framework/sessions bootstrap/cache
39-
RUN chmod -R 775 storage bootstrap/cache
40-
RUN chown -R www-data:www-data storage bootstrap/cache
41-
42-
# Installer les dépendances PHP
35+
RUN chmod +x /etc/*.sh
36+
RUN mkdir -p storage/framework/views && mkdir -p storage/framework/cache && mkdir -p storage/framework/sessions && mkdir -p bootstrap/cache
37+
RUN chmod -R 775 /var/www/deming/storage && chown -R www-data:www-data /var/www/deming
4338
RUN composer install
4439
RUN php artisan vendor:publish --all
4540

46-
# Configurer le fichier .env
4741
RUN cp .env.example .env
4842
RUN sed -i 's/DB_HOST=127\.0\.0\.1/DB_HOST=mysql/' .env
4943

50-
# Exposer le port 80
44+
COPY docker/entrypoint.sh /opt/entrypoint.sh
45+
RUN chmod u+x /opt/entrypoint.sh
46+
5147
EXPOSE 80
5248

53-
# Démarrer Nginx et PHP-FPM
54-
ENTRYPOINT ["/opt/entrypoint.sh"]
55-
CMD ["nginx", "-g", "daemon off;"]
49+
ENTRYPOINT "/opt/entrypoint.sh"

docker/docker-compose.yml

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,33 @@
11
version: "3.7"
22
services:
33
web:
4-
image: deming
5-
depends_on:
6-
mysql:
7-
condition: service_healthy
84
build:
9-
context: .
10-
dockerfile: Dockerfile
5+
context: .
6+
dockerfile: Dockerfile_web
117
environment:
12-
DB_HOST: mysql
13-
DB_DATABASE: 'deming'
14-
DB_USER: 'deming_user'
15-
DB_PASSWORD: 'demPasssword-123'
16-
DB_ROOT_PASSWORD: 'root'
17-
### PLEASE DISABLE AFTER THE FIRST RUN FOR OPTIMIZATION PRODUCTION
18-
DB_SLEEP=10
19-
### PLEASE DISABLE FOR PRODUCTION
20-
USE_DEMO_DATA=1
21-
### PLEASE DISABLE FOR PRODUCTION
22-
RESET_DB=FR #EN OR FR
23-
### PLEASE AFTER ONE RUN DISABLE FOR OPTIMIZATION
24-
UPLOAD_DB_ISO27001=FR #EN OR FR
25-
### PLEASE AFTER ONE RUN DISABLE FOR OPTIMIZATION
26-
INITIAL_DB=FR #EN OR FR
27-
TZ=Europe/Paris
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
2819
volumes:
29-
- ./custom/.env:/var/www/deming/.env
30-
- ./custom/custom_postfix_main.cf:/etc/postfix/main.cf
31-
- ./custom/custom_postfix_mailname:/etc/mailname
32-
- ./custom/deming.php:/var/www/deming/config/deming.php
33-
- ./custom/Kernel.php:/var/www/deming/app/Console/Kernel.php
34-
- ./custom/app.php:/var/www/deming/config/app.php
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
3526
ports:
36-
- 8000:80
37-
27+
- 80:80
28+
depends_on:
29+
mysql:
30+
condition: service_healthy
3831
mysql:
3932
image: mysql:8
4033
environment:
@@ -43,12 +36,12 @@ services:
4336
MYSQL_PASSWORD: 'demPasssword-123'
4437
MYSQL_ROOT_PASSWORD: 'root'
4538
expose:
46-
- 3306
39+
- 3306
4740
healthcheck:
48-
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p$${MYSQL_ROOT_PASSWORD}"]
49-
interval: 10s
50-
timeout: 5s
51-
retries: 3
41+
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p$${MYSQL_ROOT_PASSWORD}"]
42+
interval: 10s
43+
timeout: 5s
44+
retries: 3
5245
### PLEASE ENABLE FOR PERSISTENT DATABASE DATA
5346
volumes:
5447
- dbdata:/var/lib/mysql

0 commit comments

Comments
 (0)