mirror of
https://github.com/dominikhoebert/docker-projects.git
synced 2026-06-11 14:26:17 +00:00
Füge Konfigurationsdateien für Gatus, Mosquitto, Postgres und MeshDash hinzu; aktualisiere Moodle-Umgebungsvariablen und erstelle Webstack-Dokumentation
This commit is contained in:
13
webstack-task/TASK.md
Normal file
13
webstack-task/TASK.md
Normal file
@@ -0,0 +1,13 @@
|
||||
Es soll ein Webstack lokal mit Docker aufgesetzt werden.
|
||||
|
||||
1. [nginx](https://hub.docker.com/_/nginx)
|
||||
2. [PHP](https://hub.docker.com/_/php)
|
||||
3. [sftp](https://hub.docker.com/r/atmoz/sftp)
|
||||
|
||||
sftp um die Dateien zu übertragen und verwalten. nginx und PHP als Webserver.
|
||||
Hoste eine einfache Testanwendung auf dem Server.
|
||||
Verwende Docker Compose.
|
||||
|
||||
Die Lehrperson soll mit deiner IP-Adresse darauf zugreifen können.
|
||||
|
||||
Dokumentiere die Schritte hier kurz, und lade sie hoch.
|
||||
13
webstack-task/app/index.html
Normal file
13
webstack-task/app/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Webstack Task</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Webstack Task</h1>
|
||||
<p>Wenn du das siehst, liefert Nginx aus.</p>
|
||||
<p><a href="/index.php">PHP-Test öffnen</a></p>
|
||||
</body>
|
||||
</html>
|
||||
9
webstack-task/app/index.php
Normal file
9
webstack-task/app/index.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
|
||||
echo "Webstack läuft.\n";
|
||||
echo "Zeit (Server): " . date('c') . "\n";
|
||||
echo "PHP-Version: " . PHP_VERSION . "\n";
|
||||
39
webstack-task/compose.yml
Normal file
39
webstack-task/compose.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:1.27-alpine
|
||||
container_name: webstack-nginx
|
||||
depends_on:
|
||||
- php
|
||||
ports:
|
||||
- "${WEBSTACK_HTTP_PORT:-8080}:80"
|
||||
volumes:
|
||||
- ./app:/var/www/html:ro
|
||||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
networks:
|
||||
- webstack
|
||||
restart: unless-stopped
|
||||
|
||||
php:
|
||||
image: php:8.3-fpm-alpine
|
||||
container_name: webstack-php
|
||||
volumes:
|
||||
- ./app:/var/www/html:ro
|
||||
networks:
|
||||
- webstack
|
||||
restart: unless-stopped
|
||||
|
||||
sftp:
|
||||
image: atmoz/sftp:alpine
|
||||
container_name: webstack-sftp
|
||||
platform: linux/amd64
|
||||
ports:
|
||||
- "${WEBSTACK_SFTP_PORT:-2222}:22"
|
||||
volumes:
|
||||
- ./app:/home/webuser/upload
|
||||
command: "webuser:webpass:1000:1000:upload"
|
||||
networks:
|
||||
- webstack
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
webstack: {}
|
||||
22
webstack-task/nginx/default.conf
Normal file
22
webstack-task/nginx/default.conf
Normal file
@@ -0,0 +1,22 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /var/www/html;
|
||||
index index.php index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||
fastcgi_pass php:9000;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user