-
Notifications
You must be signed in to change notification settings - Fork 183
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (36 loc) · 1.17 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (36 loc) · 1.17 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
FROM php:8.3-apache
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
libzip-dev \
zip \
unzip \
git \
&& rm -rf /var/lib/apt/lists/*
# Configure and install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
gd \
mysqli \
pdo \
pdo_mysql \
zip
# Enable Apache modules
RUN a2enmod rewrite headers
# Use the production PHP configuration as a baseline, then apply our overrides
# so that errors are hidden from end users and logged server-side instead.
RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY docker/php/zz-travianz.ini "$PHP_INI_DIR/conf.d/zz-travianz.ini"
# Set working directory
WORKDIR /var/www/html
# Runtime source code is bind-mounted by docker-compose.
# Keep only minimal folder bootstrap inside the image.
RUN mkdir -p /var/www/html/var
# Configure Apache to use /var/www/html as DocumentRoot
RUN sed -i 's!/var/www/html!/var/www/html!g' /etc/apache2/sites-available/000-default.conf
# Expose Apache port
EXPOSE 80
# Start Apache
CMD ["apache2-foreground"]