Skip to content

Commit bdaec2a

Browse files
authored
Merge pull request #282 from dbarzin/dev
Dev
2 parents 3eac06a + 4e36ba4 commit bdaec2a

File tree

2 files changed

+36
-29
lines changed

2 files changed

+36
-29
lines changed

Dockerfile

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,55 @@
1-
FROM nginx:bookworm
1+
FROM php:8.2-fpm
22

3-
RUN apt update && apt dist-upgrade -y
4-
RUN apt-get install -y --no-install-recommends \
3+
# Installer les extensions PHP nécessaires
4+
RUN apt-get update && apt-get install -y \
55
git \
6-
composer \
7-
php \
8-
php-cli \
9-
php-opcache \
6+
cron \
7+
nginx \
108
php-mysql \
119
php-pgsql \
1210
php-zip \
1311
php-gd \
1412
php-mbstring \
1513
php-curl \
1614
php-xml \
17-
cron \
1815
&& apt-get clean && rm -rf /var/lib/apt/lists/*
1916

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

20+
# Définir le répertoire de travail
2621
WORKDIR /var/www/deming
2722

23+
# Cloner le dépôt Git
2824
RUN git clone https://www.github.com/dbarzin/deming .
29-
RUN cp docker/deming.conf /etc/nginx/conf.d/default.conf
30-
RUN cp docker/userdemo.sh /etc/userdemo.sh
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
3129
COPY docker/resetdb.sh /etc/resetdb.sh
32-
RUN cp docker/uploadiso27001db.sh /etc/uploadiso27001db.sh
30+
COPY docker/uploadiso27001db.sh /etc/uploadiso27001db.sh
3331
COPY docker/initialdb.sh /etc/initialdb.sh
34-
RUN chmod +x /etc/*.sh
35-
RUN mkdir -p storage/framework/views && mkdir -p storage/framework/cache && mkdir -p storage/framework/sessions && mkdir -p bootstrap/cache
36-
RUN chmod -R 775 /var/www/deming/storage && chown -R www-data:www-data /var/www/deming
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
3743
RUN composer install
3844
RUN php artisan vendor:publish --all
3945

46+
# Configurer le fichier .env
4047
RUN cp .env.example .env
4148
RUN sed -i 's/DB_HOST=127\.0\.0\.1/DB_HOST=mysql/' .env
4249

43-
COPY docker/entrypoint.sh /opt/entrypoint.sh
44-
RUN chmod u+x /opt/entrypoint.sh
45-
50+
# Exposer le port 80
4651
EXPOSE 80
4752

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

docker/docker-compose.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ services:
44
image: deming
55
depends_on:
66
mysql:
7-
condition: service_healthy
7+
condition: service_healthy
88
build:
99
context: .
10-
dockerfile: Dockerfile_web
10+
dockerfile: Dockerfile
1111
environment:
1212
DB_HOST: mysql
1313
DB_DATABASE: 'deming'
@@ -43,12 +43,12 @@ services:
4343
MYSQL_PASSWORD: 'demPasssword-123'
4444
MYSQL_ROOT_PASSWORD: 'root'
4545
expose:
46-
- 3306
46+
- 3306
4747
healthcheck:
48-
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p$${MYSQL_ROOT_PASSWORD}"]
49-
interval: 10s
50-
timeout: 5s
51-
retries: 3
48+
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p$${MYSQL_ROOT_PASSWORD}"]
49+
interval: 10s
50+
timeout: 5s
51+
retries: 3
5252
### PLEASE ENABLE FOR PERSISTENT DATABASE DATA
5353
volumes:
5454
- dbdata:/var/lib/mysql

0 commit comments

Comments
 (0)