#!/bin/bash

if [[ ! $SSMTP_FROM ]] && [[ ! $SSMTP_PASS ]]; then
    echo "Please set SSMTP_FROM and SSMTP_PASS environmental variables on the host machine before running this container."
    exit 1
fi

# Construct SSTMP config file in the container dynamically
# from host machine's env variables so that the secrets 
# are not stored in the image
/root/init-ssmtp-conf.sh

# Run Apache
/usr/local/bin/apache2-foreground