-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-php
More file actions
executable file
·70 lines (58 loc) · 1.43 KB
/
Copy pathDockerfile-php
File metadata and controls
executable file
·70 lines (58 loc) · 1.43 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
60
61
62
63
64
65
66
67
68
69
70
FROM php:8.2-fpm
# Install system dependencies and PHP extensions
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
zlib1g-dev \
libxml2-dev \
libpng-dev \
libzip-dev \
vim \
curl \
debconf \
subversion \
apt-transport-https \
apt-utils \
build-essential \
locales \
acl \
mailutils \
wget \
nodejs \
zip \
unzip \
gnupg \
sudo \
ssh \
&& docker-php-ext-install \
pdo_mysql \
soap \
zip \
opcache \
gd \
intl \
&& rm -rf /var/lib/apt/lists/*
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Install Symfony CLI
RUN curl -sS https://get.symfony.com/cli/installer | bash \
&& mv /root/.symfony*/bin/symfony /usr/local/bin/symfony
# Copy PHP configuration files
COPY ./docker/build/php/opcache.ini /usr/local/etc/php/conf.d/
COPY ./docker/build/php/error_reporting.ini /usr/local/etc/php/conf.d/
# Set working directory
WORKDIR /var/www/symfony
# Copy application files
COPY . /var/www/symfony
# Set permissions for the application directory
RUN mkdir -p /var/www/symfony/var \
&& chown -R www-data:www-data /var/www/symfony \
&& chmod -R 777 /var/www/symfony/var
# Switch to the www-data user
USER www-data
# Install Symfony dependencies
RUN composer install
#--no-dev --optimize-autoloader --no-scripts
# Expose PHP-FPM port
EXPOSE 9000
# Start PHP-FPM
CMD ["php-fpm"]