From 08d2df8cebb78917b10a72f4adf14da61f076dd7 Mon Sep 17 00:00:00 2001 From: Michel Date: Sun, 9 Oct 2022 20:37:57 +0200 Subject: [PATCH] Initial commit. --- DOCKERFILE | 29 +++++++++++++++++++++++++++++ LICENCE | 7 +++++++ README.md | 14 ++++++++++++++ docker-expose.yml | 32 ++++++++++++++++++++++++++++++++ example.env | 9 +++++++++ 5 files changed, 91 insertions(+) create mode 100644 DOCKERFILE create mode 100644 LICENCE create mode 100644 docker-expose.yml create mode 100644 example.env diff --git a/DOCKERFILE b/DOCKERFILE new file mode 100644 index 0000000..3eb9836 --- /dev/null +++ b/DOCKERFILE @@ -0,0 +1,29 @@ +FROM php:7-apache + +ARG downloadurl + +RUN apt-get update -y && apt-get upgrade -y +RUN apt-get install -y unzip zlib1g-dev libpng-dev + +RUN docker-php-ext-install pdo_mysql +RUN docker-php-ext-install mysqli +RUN docker-php-ext-install gd + +ADD $downloadurl /temp/tngfiles.zip +RUN unzip -q /temp/tngfiles.zip -d /var/www/html/ + +RUN cd /var/www/html && \ + chown -Rv www-data: adminlog.txt config.php mmconfig.php genlog.txt \ + importconfig.php logconfig.php mapconfig.php pedconfig.php \ + subroot.php whatsnew.txt \ + photos histories documents headstones media gendex backups \ + gedcom mods extensions classes + +RUN rm -r /temp/ +RUN rm -rf /var/lib/apt/lists/* +RUN apt-get remove unzip -y +RUN apt-get autoremove -y + +VOLUME /var/www/html + +CMD ["apache2-foreground"] diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..4e6dd8e --- /dev/null +++ b/LICENCE @@ -0,0 +1,7 @@ +Copyright 2022 Michel Bats + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index e69de29..0e98308 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,14 @@ +# Building and running TNG with the help of Docker Compose + +Rename example.env to .env and change "TNG_DOWNLOADURL" to your own download URL. + +Build and start TNG +``` +cd /folder/with/files/docker-tng +docker-compose up -d +``` + +#current downsides of using TNG this way + +- The "tng" volume will be filled with the website on first start but won't be updated when you rebuild the image. A similar approach as the official Wordpress Docker image should be realised. +- Only a docker volume can be used (no mounted volume) because a Docker volume will be filled with data at first start, a mounted volume won't. \ No newline at end of file diff --git a/docker-expose.yml b/docker-expose.yml new file mode 100644 index 0000000..6df3229 --- /dev/null +++ b/docker-expose.yml @@ -0,0 +1,32 @@ +version: "3.9" + +services: + tng: + build: + context: https://gogs.batssoft.nl/Michel/docker-tng/src/master/DOCKERFILE + args: + downloadurl: $TNG_DOWNLOADURL + container_name: TNG + hostname: tng + restart: unless-stopped + ports: + - ${TNG_PORT:-80}:80 + volumes: + - tng:/var/www/html + mariadb: + container_name: TNG-MariaDB + hostname: tng-mariadb + image: mariadb:latest + restart: unless-stopped + environment: + MARIADB_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-mysql_root_password} + MARIADB_TCP_PORT: ${MARIADB_PORT:-3306} + MARIADB_USER: ${MARIADB_USER:-tng} + MARIADB_PASSWORD: ${MARIADB_PASSWORD:-tng} + MARIADB_DATABASE: ${MARIADB_DATABASE:-tng} + volumes: + - tng-mariadb:/var/lib/mysql + +volumes: + tng: + tng-mariadb: \ No newline at end of file diff --git a/example.env b/example.env new file mode 100644 index 0000000..0f42422 --- /dev/null +++ b/example.env @@ -0,0 +1,9 @@ +TNG_DOWNLOADURL=https://:@tng.lythgoes.net/downloads/tngfiles.zip + +# Uncomment and change the following variables if you want to use them. +#TNG_PORT= +#MYSQL_ROOT_PASSWORD= +#MARIADB_PORT= +#MARIADB_USER= +#MARIADB_PASSWORD= +#MARIADB_DATABASE= \ No newline at end of file