Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (27 loc) · 1.53 KB
/
Copy pathDockerfile
File metadata and controls
35 lines (27 loc) · 1.53 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
# Animal System — CodeIgniter 2 app on PHP 7.4 + Apache
FROM php:7.4-apache
# The PHP 7.4 image is based on Debian 11 (bullseye), which is end-of-life,
# so packages come from the Debian archive.
RUN printf 'deb http://archive.debian.org/debian bullseye main\ndeb http://archive.debian.org/debian-security bullseye-security main\n' > /etc/apt/sources.list \
&& rm -f /etc/apt/sources.list.d/*
# System libraries needed by the PHP extensions below
RUN apt-get update && apt-get install -y --no-install-recommends \
libfreetype6-dev libjpeg62-turbo-dev libpng-dev libwebp-dev \
libzip-dev libonig-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j"$(nproc)" mysqli pdo_mysql gd zip bcmath exif mbstring \
&& a2enmod rewrite headers expires remoteip setenvif \
&& rm -rf /var/lib/apt/lists/*
# PHP settings (same values as htaccess_examples/php.ini)
COPY docker/php.ini /usr/local/etc/php/conf.d/zz-app.ini
# Allow .htaccess files to work
RUN sed -ri 's!AllowOverride None!AllowOverride All!g' /etc/apache2/apache2.conf \
&& echo 'ServerName localhost' >> /etc/apache2/apache2.conf
# Trust HTTPS / client IP headers from the reverse proxy
COPY docker/apache-proxy.conf /etc/apache2/conf-enabled/zz-proxy.conf
WORKDIR /var/www/html
COPY --chown=www-data:www-data public_html/ /var/www/html/
# Folders the app writes to
RUN mkdir -p application/logs application/cache files \
&& chown -R www-data:www-data application/logs application/cache files
EXPOSE 80