-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (47 loc) · 1.71 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (47 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM php:8.4-fpm-alpine
# Dépendances système
RUN apk add --no-cache \
nginx \
git \
curl \
zip \
unzip \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
libzip-dev \
oniguruma-dev \
mysql-client \
supervisor
# Extensions PHP
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo pdo_mysql mbstring zip exif pcntl bcmath gd opcache
# Extension imagick (requis par spatie/pdf-to-image) + zbar (QR scan papier)
RUN apk add --no-cache imagemagick zbar \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS imagemagick-dev \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& apk del .build-deps
# Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
# Dépendances Composer d'abord (cache layer)
COPY composer.json composer.lock ./
RUN composer install --no-dev --optimize-autoloader --no-interaction --no-scripts
# Code source
COPY . .
# Supprimer le schema dump (évite le problème SSL client MariaDB vs MySQL 8.0)
RUN rm -f database/schema/mysql-schema.sql
# Scripts post-install
RUN composer run-script post-autoload-dump || true \
&& php artisan config:cache \
&& php artisan route:cache \
&& php artisan view:cache
# Permissions
RUN mkdir -p storage/app/public storage/logs storage/framework/cache storage/framework/sessions storage/framework/views bootstrap/cache \
&& chown -R www-data:www-data storage bootstrap/cache \
&& chmod -R 775 storage bootstrap/cache
COPY docker/nginx/default.conf /etc/nginx/http.d/default.conf
COPY docker/supervisord.conf /etc/supervisord.conf
EXPOSE 80
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]