1
0
Fork 0
mirror of https://github.com/fernwerker/ownDynDNS.git synced 2025-07-10 14:15:14 +02:00

moved nginx into php dockerfile, start not automatic yet

This commit is contained in:
niiwiicamo 2024-07-23 16:07:21 +02:00
parent 75cdfe319a
commit 465c7447f3
5 changed files with 53 additions and 12 deletions

11
Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM php:fpm-alpine
RUN apk add --no-cache nginx libxml2-dev \
&& docker-php-ext-install soap \
&& mkdir -p /var/www/html/src
COPY ./default.conf /etc/nginx/http.d/default.conf
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
WORKDIR /var/www/html
EXPOSE 80

View file

@ -17,4 +17,45 @@ if (!file_exists('.env')) {
$config = parse_ini_file('.env', false, INI_SCANNER_TYPED);
if (getenv('DDNS_USER') !== false) {
$config['username'] = getenv('DDNS_USER');
}
if (getenv('DDNS_PASS') !== false) {
$config['password'] = getenv('DDNS_PASS');
}
if (getenv('NETCUP_APIKEY') !== false) {
$config['apiKey'] = getenv('NETCUP_APIKEY');
}
if (getenv('NETCUP_APIPASS') !== false) {
$config['apiPassword'] = getenv('NETCUP_APIPASS');
}
if (getenv('NETCUP_CUSTOMERID') !== false) {
$config['customerId'] = getenv('NETCUP_CUSTOMERID');
}
if (getenv('DDNS_DEBUG') !== false) {
$config['debug'] = getenv('DDNS_DEBUG');
}
if (getenv('DDNS_LOG') !== false) {
$config['log'] = getenv('DDNS_LOG');
}
if (getenv('DDNS_LOGFILE') !== false) {
$config['logFile'] = getenv('DDNS_LOGFILE');
}
if (getenv('DDNS_RETURNIP') !== false) {
$config['returnIp'] = getenv('DDNS_RETURNIP');
}
if (getenv('DDNS_ALLOWCREATE') !== false) {
$config['allowCreate'] = getenv('DDNS_ALLOWCREATE');
}
if (getenv('DDNS_RESTRICTDOMAIN') !== false) {
$config['restrictDomain'] = getenv('DDNS_RESTRICTDOMAIN');
}
if (getenv('DDNS_FORCEDDOMAIN') !== false) {
$config['domain'] = getenv('DDNS_FORCEDDOMAIN');
}
if (getenv('DDNS_FORCEDHOST') !== false) {
$config['host'] = getenv('DDNS_FORCEDHOST');
}
print_r ($config);
(new netcup\DNS\API\Handler($config, $_REQUEST))->doRun();

View file

@ -6,7 +6,7 @@ server {
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass php:9000;
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}

View file

@ -1,7 +0,0 @@
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

View file

@ -1,4 +0,0 @@
FROM php:fpm-alpine
RUN apk add --no-cache libxml2-dev \
&& docker-php-ext-install soap
VOLUME /var/www/html