-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.prod
More file actions
61 lines (48 loc) · 1.58 KB
/
Dockerfile.prod
File metadata and controls
61 lines (48 loc) · 1.58 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
# Use a smaller Ubuntu base image (24.04 → PHP 8.3)
FROM ubuntu:24.04
# Set timezone
ENV TZ=Europe/Berlin
# Set geographic area using above variable
# This is necessary, otherwise building the image doesn't work
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Remove annoying messages during package installation
ARG DEBIAN_FRONTEND=noninteractive
# Install packages: web server & PHP plus extensions
RUN apt-get update && apt-get install -y \
apache2 \
apache2-utils \
ca-certificates \
php \
libapache2-mod-php \
php-curl \
php-dom \
php-gd \
php-intl \
php-json \
php-mbstring \
php-xml \
php-zip \
git \
git-lfs \
cron && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Initialize Git LFS
RUN git lfs install
# Enable SSL module and site configuration
RUN a2enmod ssl
RUN a2ensite default-ssl
# Copy virtual host configuration from current path onto existing 000-default.conf
COPY default.prod.conf /etc/apache2/sites-available/000-default.conf
# Copy custom PHP config (PHP 8.3 on Ubuntu 24.04; volume mount in deploy overrides at runtime)
COPY custom-php.prod.ini /etc/php/8.3/apache2/conf.d/custom-php.ini
# Remove default content (existing index.html)
RUN rm /var/www/html/*
# Activate Apache modules headers & rewrite
RUN a2enmod headers rewrite
# Change web server's user id to match local user, replace with your local user id
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["entrypoint.sh"]
# Tell container to listen to port 80 at runtime
EXPOSE 80 443
# Start Apache web server
CMD [ "/usr/sbin/apache2ctl", "-DFOREGROUND" ]