Files
4get-apache/entrypoint.sh
2025-06-23 11:35:38 -04:00

27 lines
705 B
Bash
Executable File

#!/bin/sh
set -e
# Use provided PUID and PGID or fall back to defaults
PUID=${PUID:-1001}
PGID=${PGID:-1001}
PORT=${PORT:-80}
CHMOD=${CHMOD:-771}
echo "Creating container user & group \"abc\" with UID: ${PUID} and GID: ${PGID}..."
groupadd -g $PGID abc
useradd -u $PUID -g abc -m abc
echo "Generating 4get data/config.php from env..."
php /gen_config.php
echo "Setting 4get file permissions..."
chown -R abc:abc /var/www/html/4get
chmod -R $CHMOD /var/www/html/4get
echo "Changing port in /etc/apache2/httpd.conf to ${PORT}..."
sed -i "s/^Listen .*/Listen ${PORT}/" /etc/apache2/httpd.conf
echo "Starting apache2 webserver..."
echo "4get should be up and running! :)"
httpd -k start -D FOREGROUND