-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (44 loc) · 1.38 KB
/
Dockerfile
File metadata and controls
55 lines (44 loc) · 1.38 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
FROM php:7.4-apache
# Set working directory
WORKDIR /var/www/html
# Install system dependencies
RUN apt-get update && apt-get install -y \
libcurl4-openssl-dev \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libonig-dev \
libmagickwand-dev \
zip \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
curl \
gd \
mbstring \
pdo \
pdo_mysql
# Install Imagick extension from PECL
RUN pecl install imagick-3.7.0 \
&& docker-php-ext-enable imagick
# Enable Apache modules
RUN a2enmod rewrite
# Install wkhtmltoimage (optional - best quality rendering)
# This is optional and may fail - the app will fall back to GD
RUN wget -q https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.buster_amd64.deb \
&& dpkg -i wkhtmltox_0.12.6.1-3.buster_amd64.deb || apt-get install -f -y || true \
&& (rm -f wkhtmltox_0.12.6.1-3.buster_amd64.deb || true) || true
# Create output directory
RUN mkdir -p /var/www/html/assets/media/rapidhtml2png \
&& chown -R www-data:www-data /var/www/html/assets
# Copy project files
COPY . /var/www/html/
# Set permissions
RUN chown -R www-data:www-data /var/www/html
# Expose port 80
EXPOSE 80
# Start Apache in foreground
CMD ["apache2-foreground"]