-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (44 loc) · 1.55 KB
/
Dockerfile
File metadata and controls
54 lines (44 loc) · 1.55 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
# base image with Apache & PHP 8.1 (bullseye)
FROM php:8.1.31-apache-bullseye
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libicu-dev \
libzip-dev
# Install PHP extensions
RUN docker-php-ext-install mbstring exif pcntl bcmath gd intl zip
# Set PHP memory limit
RUN echo "memory_limit = 256M" > /usr/local/etc/php/conf.d/memory-limit.ini
# Install Xdebug
RUN pecl install xdebug && docker-php-ext-enable xdebug intl
# Configure Xdebug
RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/xdebug.ini
# Enable Apache modules
RUN a2enmod rewrite headers ssl
# Generate SSL certificates
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /etc/ssl/private/localhost.key \
-out /etc/ssl/certs/localhost.crt \
-subj "/C=US/ST=State/L=City/O=Company/CN=localhost"
# Configure Apache SSL
RUN echo "<VirtualHost *:443>\n\
ServerName localhost\n\
DocumentRoot /var/www/html\n\
SSLEngine on\n\
SSLCertificateFile /etc/ssl/certs/localhost.crt\n\
SSLCertificateKeyFile /etc/ssl/private/localhost.key\n\
<Directory /var/www/html>\n\
AllowOverride All\n\
Require all granted\n\
</Directory>\n\
</VirtualHost>" > /etc/apache2/sites-available/default-ssl.conf
RUN a2ensite default-ssl.conf
WORKDIR /var/www/html