diff --git a/.gitignore b/.gitignore index 8f940ba..6963723 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,10 @@ !.vscode/extensions.json *.code-workspace + config.php +./config.php + diff --git a/config.sample.php b/config.sample.php index 3a87685..a5a85ad 100644 --- a/config.sample.php +++ b/config.sample.php @@ -4,7 +4,7 @@ date_default_timezone_set('UTC'); $db_server = "mariadb"; $db_user = "dbuser"; -$db_passwd = "dbpassword"; +$db_passwd = "geheim"; $db = "unfallstatistik"; diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b7230e1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,66 @@ +version: '3' + +services: + unfallkarte: + image: php81:v1 + container_name: unfallkarte + volumes: + - /opt/containers/webserver/unfallkarte/html:/var/www/html + labels: + - "traefik.enable=true" + - "traefik.http.routers.unfallkarte.entrypoints=https" + - "traefik.http.routers.unfallkarte.rule=Host(`unfallkarte.bankerheide.de`,`unfallkarte.hpadm.de`,`unfallkarte.adfc-hamm.de`,`unfallkarte.radwege-hamm.de`,`www.unfallkarte.adfc-hamm.de`,`www.unfallkarte.radwege-hamm.de`)" + - "traefik.http.routers.unfallkarte.tls=true" + - "traefik.http.routers.unfallkarte.tls.certresolver=http" + - "traefik.http.routers.unfallkarte.middlewares=default@file" + - "traefik.http.routers.unfallkarte.service=unfallkarte" + - "traefik.http.services.unfallkarte.loadbalancer.server.port=80" + - "traefik.docker.network=proxy" + networks: + - default + - proxy + restart: always + + webserver-db: + image: mariadb + container_name: webserver-db + restart: unless-stopped + environment: + - MYSQL_ROOT_PASSWORD=geheim #SQL root Passwort eingeben + - MYSQL_INITDB_SKIP_TZINFO=1 + - MARIADB_AUTO_UPGRADE=1 + volumes: + - ./database:/var/lib/mysql + networks: + - default + - proxy + + phpmyadmin: + image: phpmyadmin/phpmyadmin + container_name: phpmyadmin + environment: + - PMA_HOST=webserver-db + - PMA_PORT=3306 + - UPLOAD_LIMIT=300M + restart: always + labels: + - "traefik.enable=true" + - "traefik.http.routers.phpmyadmin-secure.entrypoints=https" + - "traefik.http.routers.phpmyadmin-secure.rule=Host(`db.intern.bankerheide.de`)" + - "traefik.http.routers.phpmyadmin-secure.tls=true" + - "traefik.http.routers.phpmyadmin-secure.tls.certresolver=http" + - "traefik.http.routers.phpmyadmin-secure.service=phpmyadmin-secure" + - "traefik.http.services.phpmyadmin-secure.loadbalancer.server.port=80" + - "traefik.http.routers.phpmyadmin-secure.middlewares=traefikAuth@file,default@file" + - "traefik.docker.network=proxy" + networks: + - default + - proxy + volumes: + - /sessions + + + +networks: + proxy: + external: true diff --git a/php81-apache/Dockerfile b/php81-apache/Dockerfile new file mode 100644 index 0000000..c67c6db --- /dev/null +++ b/php81-apache/Dockerfile @@ -0,0 +1,7 @@ +FROM php:8.1-apache +RUN apt-get update && docker-php-ext-install pdo_mysql calendar mysqli + +RUN a2enmod rewrite headers + +COPY . /var/www +EXPOSE 80 \ No newline at end of file