From 2842c05f611263ca444c4890083b9fee740f47df Mon Sep 17 00:00:00 2001 From: "Florian Meissner, DL1MRV" Date: Tue, 11 Jul 2023 23:07:20 +0200 Subject: [PATCH] Initial commit --- .gitignore | 137 ++++++++++++++++++++++++++++ .gitmodules | 3 + backend | 1 + nginx/Dockerfile | 22 +++++ nginx/etc/nginx/conf.d/default.conf | 19 ++++ nginx/nginx.env | 0 php-fpm/Dockerfile | 36 ++++++++ php-fpm/entrypoint.sh | 31 +++++++ php-fpm/etc/php/adb.ini | 16 ++++ php-fpm/php.env | 0 10 files changed, 265 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 160000 backend create mode 100644 nginx/Dockerfile create mode 100644 nginx/etc/nginx/conf.d/default.conf create mode 100644 nginx/nginx.env create mode 100644 php-fpm/Dockerfile create mode 100755 php-fpm/entrypoint.sh create mode 100644 php-fpm/etc/php/adb.ini create mode 100644 php-fpm/php.env diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3d743e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,137 @@ +# Configuration files +config.php + +# Docker Secrets +**/secrets/ + +# Include all README files +!**/README.md + +# Eclipse +.settings +.buildpath +.project +.pydevproject + +.bak + +### WINDOWS ### +desktop.ini + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory +__MACOSX + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### PhpStorm+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### PhpStorm+all Patch ### +# Ignores the whole .idea folder and all .iml files +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + +.idea/ + +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1151429 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "backend"] + path = backend + url = ./backend/ diff --git a/backend b/backend new file mode 160000 index 0000000..a2291b4 --- /dev/null +++ b/backend @@ -0,0 +1 @@ +Subproject commit a2291b4a1f006b6035f7bf5afc1e83ad874b8e3f diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..ff9405b --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,22 @@ +# *********************************************************************************************************************************** +# * ___, _ ____ , __ * +# * / | o | | (| \ /|/ \ | * +# * | | ,_ ,_ __, | | | | _ _ __, ,_ _|_ ,_ _ | __/ __ __, ,_ __| * +# * | | / | / | | | |_/ | |/ _| ||/ |/ \_/ | / | | | | / | |/ | \/ \_/ | / | / | * +# * \__/\_/ |_/ |_/|_/ \/ \_/|_/|__/ (/\___/ |__/|__/ \_/|_/ |_/|_/ \_/|_/ |_/|__/ |(__/\__/ \_/|_/ |_/\_/|_/ * +# * /| * +# * \| * +# * * +# *********************************************************************************************************************************** + +ARG NGINX_VERSION +FROM nginx:${NGINX_VERSION} + +# Set timezone +RUN apk add --no-cache tzdata +ENV TZ=Etc/UTC + +# Copy configurations +COPY etc/ /etc + +WORKDIR /var/www/html diff --git a/nginx/etc/nginx/conf.d/default.conf b/nginx/etc/nginx/conf.d/default.conf new file mode 100644 index 0000000..d93a923 --- /dev/null +++ b/nginx/etc/nginx/conf.d/default.conf @@ -0,0 +1,19 @@ +server { + listen 80; + root /var/www/html; + server_name adb.european-airports.org; + index index.php; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_pass php:9000; + fastcgi_index index.php; + fastcgi_param REQUEST_METHOD $request_method; + fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; + } + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + +} \ No newline at end of file diff --git a/nginx/nginx.env b/nginx/nginx.env new file mode 100644 index 0000000..e69de29 diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile new file mode 100644 index 0000000..f17bb03 --- /dev/null +++ b/php-fpm/Dockerfile @@ -0,0 +1,36 @@ +# *********************************************************************************************************************************** +# * ___, _ ____ , __ * +# * / | o | | (| \ /|/ \ | * +# * | | ,_ ,_ __, | | | | _ _ __, ,_ _|_ ,_ _ | __/ __ __, ,_ __| * +# * | | / | / | | | |_/ | |/ _| ||/ |/ \_/ | / | | | | / | |/ | \/ \_/ | / | / | * +# * \__/\_/ |_/ |_/|_/ \/ \_/|_/|__/ (/\___/ |__/|__/ \_/|_/ |_/|_/ \_/|_/ |_/|__/ |(__/\__/ \_/|_/ |_/\_/|_/ * +# * /| * +# * \| * +# * * +# *********************************************************************************************************************************** + +ARG PHP_VERSION +FROM php:${PHP_VERSION} + +# Set timezone +RUN apk add --no-cache tzdata +ENV TZ=Etc/UTC + +# Install PHP config +RUN mv /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini +COPY etc/php /usr/local/etc/php/conf.d + +# Install dependencies +RUN apk update && \ + apk upgrade && \ + apk add git && \ + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \ + rm -rf /var/cache/apk/* + +# Install and execute own entrypoint script. This scrpit should hold all instructions that are not +# executed while the image is build (use RUN in this file therefore) but that are run when the +# container starts up. One major advanatge is that mounted volumes are already available when this +# script is executed. +COPY entrypoint.sh /entrypoint.sh +RUN ["chmod", "+x", "/entrypoint.sh"] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/php-fpm/entrypoint.sh b/php-fpm/entrypoint.sh new file mode 100755 index 0000000..c01d880 --- /dev/null +++ b/php-fpm/entrypoint.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# *********************************************************************************************************************************** +# * ___, _ ____ , __ * +# * / | o | | (| \ /|/ \ | * +# * | | ,_ ,_ __, | | | | _ _ __, ,_ _|_ ,_ _ | __/ __ __, ,_ __| * +# * | | / | / | | | |_/ | |/ _| ||/ |/ \_/ | / | | | | / | |/ | \/ \_/ | / | / | * +# * \__/\_/ |_/ |_/|_/ \/ \_/|_/|__/ (/\___/ |__/|__/ \_/|_/ |_/|_/ \_/|_/ |_/|__/ |(__/\__/ \_/|_/ |_/\_/|_/ * +# * /| * +# * \| * +# * * +# *********************************************************************************************************************************** + +# This file provides a set of instructions to run, when the container starts. It is anchored as the +# entrypoint in the Dockerfile. + +# Florian Meissner, DL1MRV + +# Install PHP composer dependencies. This is done every time, the container is (re-)started. +composer -d /var/www/html -n update +composer -d /var/www/html -n install --no-dev + +# Generate translation files +# /generate_mo.sh + +# Create log dir +mkdir -p -m 777 /var/www/html/logs + +# Finally start PHP. +source /usr/local/bin/docker-php-entrypoint +php-fpm \ No newline at end of file diff --git a/php-fpm/etc/php/adb.ini b/php-fpm/etc/php/adb.ini new file mode 100644 index 0000000..2434a9f --- /dev/null +++ b/php-fpm/etc/php/adb.ini @@ -0,0 +1,16 @@ +; *********************************************************************************************************************************** +; * ___, _ ____ , __ * +; * / | o | | (| \ /|/ \ | * +; * | | ,_ ,_ __, | | | | _ _ __, ,_ _|_ ,_ _ | __/ __ __, ,_ __| * +; * | | / | / | | | |_/ | |/ _| ||/ |/ \_/ | / | | | | / | |/ | \/ \_/ | / | / | * +; * \__/\_/ |_/ |_/|_/ \/ \_/|_/|__/ (/\___/ |__/|__/ \_/|_/ |_/|_/ \_/|_/ |_/|__/ |(__/\__/ \_/|_/ |_/\_/|_/ * +; * /| * +; * \| * +; * * +; *********************************************************************************************************************************** +; +; Author: Florian Meissner, DL1MRV + +memory_limit = 256M +session.cookie_lifetime = 1440 +session.gc_maxlifetime = 1440 \ No newline at end of file diff --git a/php-fpm/php.env b/php-fpm/php.env new file mode 100644 index 0000000..e69de29