start-apache.sh 868 B

123456789101112131415161718192021
  1. #!/usr/bin/env bash
  2. #
  3. # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. #
  6. set -e
  7. SCRIPT_DIR="${0%/*}"
  8. docker rm -f apache 2>/dev/null > /dev/null
  9. docker run -d --name apache -v $2:/var/www/html -v /var/www/html/data -v /var/www/html/config -v /var/www/html/extra-apps -v /tmp/shared:/shared --dns $1 --hostname httpd.domain.test icewind1991/samba-krb-test-apache 1>&2
  10. APACHE_IP=$(docker inspect apache --format '{{.NetworkSettings.IPAddress}}')
  11. docker exec apache chown 33 /var/www/html/config /var/www/html/data /var/www/html/extra-apps
  12. docker cp "$SCRIPT_DIR/apps.config.php" apache:/var/www/html/config/apps.config.php
  13. # add the dns record for apache
  14. docker exec dc samba-tool dns add krb.domain.test domain.test httpd A $APACHE_IP -U administrator --password=passwOrd1 1>&2
  15. echo $APACHE_IP