build.sh 1.25 KB
Newer Older
ale's avatar
ale committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh
#
# Install script for apache2-users inside a Docker container.
#

# Packages that are only used to build the container. These will be
# removed once we're done.
BUILD_PACKAGES="rsync"

# Packages required to serve the website and run the services.
# We have to keep the python3 packages around in order to run
# chaperone (installed via pip).
PACKAGES="
ale's avatar
ale committed
14
	curl
ale's avatar
ale committed
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
	apache2
	apache-exporter
	libapache2-mod-removeip

	php-cli
	php-fpm
	php-mysql
	php-gd
"

# The default bitnami/minideb image defines an 'install_packages'
# command which is just a convenient helper. Define our own in
# case we are using some other Debian image.
if [ "x$(which install_packages)" = "x" ]; then
    install_packages() {
        env DEBIAN_FRONTEND=noninteractive apt-get install -qy -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --no-install-recommends "$@"
    }
fi

set -x
set -e

install_packages ${BUILD_PACKAGES} ${PACKAGES}

# Rsync our configuration, on top of /etc.
rsync -a /tmp/conf/ /etc/

42 43
# Make sure /usr/local/bin/setup-apache.sh is executable.
chmod +x /usr/local/bin/setup-apache.sh
ale's avatar
ale committed
44 45

# Remove packages used for installation.
46
apt-get remove -y --purge ${BUILD_PACKAGES}
ale's avatar
ale committed
47 48 49 50
apt-get autoremove -y
apt-get clean
rm -fr /var/lib/apt/lists/*
rm -fr /tmp/conf