diff --git a/.env.dist b/data/.env.dist similarity index 100% rename from .env.dist rename to data/.env.dist diff --git a/src/Config.php b/data/src/Config.php similarity index 100% rename from src/Config.php rename to data/src/Config.php diff --git a/src/Handler.php b/data/src/Handler.php similarity index 100% rename from src/Handler.php rename to data/src/Handler.php diff --git a/src/Payload.php b/data/src/Payload.php similarity index 100% rename from src/Payload.php rename to data/src/Payload.php diff --git a/src/Soap.php b/data/src/Soap.php similarity index 100% rename from src/Soap.php rename to data/src/Soap.php diff --git a/update.php b/data/update.php similarity index 100% rename from update.php rename to data/update.php diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..69e5ddb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: "3" +services: + + nginx: + build: + context: . + dockerfile: nginx/Dockerfile + image: nginx:alpine + ports: + - "8180:80" + volumes: + - data:/var/www/html + + php: + build: + context: . + dockerfile: php/Dockerfile + depends_on: + - nginx + volumes: + - data:/var/www/html + +volumes: + data: \ No newline at end of file diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..d38e37c --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,7 @@ +FROM nginx:alpine +RUN mkdir -p /var/www/html/src +COPY nginx/default.conf /etc/nginx/conf.d/ +COPY ./data/src/ /var/www/html/src +COPY ./data/update.php /var/www/html +COPY ./data/.env.dist /var/www/html/.env +VOLUME /var/www/html diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..03ad75d --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,13 @@ +server { + listen 0.0.0.0:80; + root /var/www/html; + location / { + return 302 https://github.com/NiiWiiCamo/ownDynDNS; + } + location ~ \.php$ { + include fastcgi_params; + fastcgi_pass php:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; + } +} \ No newline at end of file diff --git a/php/Dockerfile b/php/Dockerfile new file mode 100644 index 0000000..128620b --- /dev/null +++ b/php/Dockerfile @@ -0,0 +1,2 @@ +FROM php:fpm-alpine +VOLUME /var/www/html \ No newline at end of file