-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (44 loc) · 1.51 KB
/
Dockerfile
File metadata and controls
59 lines (44 loc) · 1.51 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.5-fpm-alpine
# Extensions système nécessaires
RUN apk add --no-cache \
git \
unzip \
curl \
icu-dev \
libpq-dev \
rabbitmq-c-dev \
linux-headers \
poppler-utils \
$PHPIZE_DEPS
# Extensions PHP (RUN separees — opcache deja builtin dans 8.5-fpm-alpine)
RUN docker-php-ext-install intl
RUN docker-php-ext-install pdo_pgsql
RUN docker-php-ext-install pgsql
# AMQP pour RabbitMQ (Symfony Messenger)
RUN pecl install amqp && docker-php-ext-enable amqp
# APCu pour le cache Symfony
RUN pecl install apcu && docker-php-ext-enable apcu
# Xdebug pour le coverage + debug
RUN pecl install xdebug && docker-php-ext-enable xdebug
# Config PHP dev
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
COPY docker/php/conf.d/symfony.ini $PHP_INI_DIR/conf.d/symfony.ini
COPY docker/php/conf.d/xdebug.ini $PHP_INI_DIR/conf.d/xdebug.ini
# Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER=1
# Symfony CLI (optionnel mais pratique pour le serve et les checks)
RUN curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.alpine.sh' | sh \
&& apk add --no-cache symfony-cli
WORKDIR /app
# On installe les dépendances au build si composer.json existe
COPY composer.json composer.lock* ./
RUN if [ -f composer.lock ]; then \
composer install --no-scripts --no-autoloader --prefer-dist; \
fi
COPY . .
RUN if [ -f composer.lock ]; then \
composer dump-autoload --optimize; \
fi
EXPOSE 9000
CMD ["php-fpm"]