2024-12-30 22:50:05 +01:00
|
|
|
FROM debian:12-slim
|
|
|
|
RUN <<EOF
|
|
|
|
set -e
|
2025-01-02 16:54:24 +01:00
|
|
|
export PHP_VERSION=8.3
|
|
|
|
|
2024-12-30 22:50:05 +01:00
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
export DEBCONF_NONINTERACTIVE_SEEN=true
|
|
|
|
apt-get update && apt-get dist-upgrade -uy
|
2024-12-31 19:53:17 +01:00
|
|
|
|
2024-12-30 22:50:05 +01:00
|
|
|
apt-get -y install lsb-release ca-certificates curl
|
|
|
|
curl -sSLo /tmp/debsuryorg-archive-keyring.deb \
|
|
|
|
https://packages.sury.org/debsuryorg-archive-keyring.deb
|
|
|
|
dpkg -i /tmp/debsuryorg-archive-keyring.deb
|
2024-12-31 12:13:52 +01:00
|
|
|
rm -f /tmp/debsuryorg-archive-keyring.deb
|
2024-12-30 22:50:05 +01:00
|
|
|
echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" \
|
|
|
|
> /etc/apt/sources.list.d/php.list
|
|
|
|
apt-get update
|
2025-01-02 16:54:24 +01:00
|
|
|
apt-get install -y apache2 libapache2-mod-php${PHP_VERSION} msmtp \
|
|
|
|
php${PHP_VERSION}-cli php${PHP_VERSION}-opcache \
|
|
|
|
php${PHP_VERSION}-pgsql php${PHP_VERSION}-xml socat
|
2024-12-31 19:53:17 +01:00
|
|
|
|
2024-12-31 13:54:12 +01:00
|
|
|
adduser --system --ingroup www-data \
|
2025-01-02 14:04:58 +01:00
|
|
|
--shell '/bin/false' \
|
2024-12-30 22:50:05 +01:00
|
|
|
--comment 'LWB5 Ticks' \
|
|
|
|
--home /opt/lwb5 --no-create-home \
|
|
|
|
lwticks
|
2024-12-31 19:53:17 +01:00
|
|
|
|
2025-01-02 16:54:24 +01:00
|
|
|
for what in apache2 cli; do
|
|
|
|
cat >/etc/php/${PHP_VERSION}/${what}/conf.d/99-smtp.ini <<EOC
|
|
|
|
[mail function]
|
|
|
|
sendmail_path = "/usr/bin/msmtp -t"
|
|
|
|
EOC
|
|
|
|
done
|
|
|
|
|
2024-12-31 19:53:17 +01:00
|
|
|
a2dismod mpm_event
|
|
|
|
a2enmod mpm_prefork
|
2024-12-30 22:50:05 +01:00
|
|
|
/bin/echo -e "Listen 80\nListen 81" > /etc/apache2/ports.conf
|
|
|
|
cat > /etc/apache2/sites-available/lwb5-main.conf <<EOC
|
|
|
|
<VirtualHost *:80>
|
|
|
|
ServerAdmin webmaster@localhost
|
|
|
|
DocumentRoot /opt/lwb5/site
|
|
|
|
ErrorLog /dev/stderr
|
|
|
|
CustomLog /dev/stdout combined
|
|
|
|
<Directory /opt/lwb5/site>
|
|
|
|
Require all granted
|
|
|
|
php_flag log_errors on
|
|
|
|
php_value error_log syslog
|
|
|
|
</Directory>
|
|
|
|
<Files "*.inc">
|
|
|
|
Require all denied
|
|
|
|
</Files>
|
|
|
|
</VirtualHost>
|
|
|
|
EOC
|
|
|
|
cat > /etc/apache2/sites-available/lwb5-admin.conf <<EOC
|
|
|
|
<VirtualHost *:81>
|
|
|
|
ServerAdmin webmaster@localhost
|
|
|
|
DocumentRoot /opt/lwb5/admin
|
|
|
|
ErrorLog /dev/stderr
|
|
|
|
CustomLog /dev/stdout combined
|
|
|
|
<Directory /opt/lwb5/admin>
|
|
|
|
Require all granted
|
|
|
|
php_flag log_errors on
|
|
|
|
php_value error_log syslog
|
|
|
|
</Directory>
|
|
|
|
<Files "*.inc">
|
|
|
|
Require all denied
|
|
|
|
</Files>
|
|
|
|
</VirtualHost>
|
|
|
|
EOC
|
|
|
|
a2dissite 000-default
|
|
|
|
a2ensite lwb5-main
|
|
|
|
a2ensite lwb5-admin
|
2024-12-31 19:53:17 +01:00
|
|
|
|
|
|
|
mkdir /var/spool/pgen
|
|
|
|
chgrp www-data /var/spool/pgen
|
|
|
|
chmod 1775 /var/spool/pgen
|
2024-12-30 22:50:05 +01:00
|
|
|
EOF
|
|
|
|
|
2025-01-02 10:58:09 +01:00
|
|
|
VOLUME /var/spool/pgen
|
2024-12-30 22:50:05 +01:00
|
|
|
EXPOSE 80 81
|
2025-01-02 14:04:58 +01:00
|
|
|
|
|
|
|
ADD game /opt/lwb5
|
|
|
|
|
2024-12-30 22:50:05 +01:00
|
|
|
ENTRYPOINT ["/opt/lwb5/run-lwb5.sh"]
|