1st commit, gotta add readme stuff
This commit is contained in:
30
entrypoint.sh
Executable file
30
entrypoint.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Default PUID and PGID
|
||||
DEFAULT_PUID=1001
|
||||
DEFAULT_PGID=1001
|
||||
DEFAULT_PORT=80
|
||||
|
||||
# Use provided PUID and PGID or fall back to defaults
|
||||
PUID=${PUID:-$DEFAULT_PUID}
|
||||
PGID=${PGID:-$DEFAULT_PGID}
|
||||
PORT=${PORT:-$DEFAULT_PORT}
|
||||
|
||||
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 771 /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
|
Reference in New Issue
Block a user