docker setup

This commit is contained in:
Ulf Gebhardt 2024-03-18 10:44:57 +01:00
parent 18a3e3c407
commit 7643624aef
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
6 changed files with 76 additions and 0 deletions

39
docker-compose.yml Normal file
View File

@ -0,0 +1,39 @@
version: "3.4"
services:
mariadb:
build:
context: ./docker
dockerfile: ./Dockerfile.mariadb
environment:
#- MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1
- MARIADB_ROOT_PASSWORD=SECRET
- MARIADB_USER=web
ports:
- 3306:3306
volumes:
- db_vol:/var/lib/mysql
php:
build:
context: .
dockerfile: ./docker/Dockerfile.php
volumes:
- ./:/app
user: "1000"
nginx:
build:
context: .
dockerfile: ./docker/Dockerfile.nginx
depends_on:
- php
- mariadb
ports:
- 80:80
volumes:
- ./nginx/log:/var/log/nginx
- ./:/app
volumes:
db_vol:

View File

@ -0,0 +1 @@
FROM mariadb:latest

3
docker/Dockerfile.nginx Normal file
View File

@ -0,0 +1,3 @@
FROM nginx:latest
COPY ../nginx/default.conf /etc/nginx/conf.d/default.conf

5
docker/Dockerfile.php Normal file
View File

@ -0,0 +1,5 @@
FROM php:8.2-fpm-alpine
# RUN docker-php-ext-install pdo pdo_mysql mbstring
# RUN apk add sqlite
RUN docker-php-ext-install session mysqli

26
nginx/default.conf Normal file
View File

@ -0,0 +1,26 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
root /app;
index index.php;
rewrite ^(.*)/webfonts/(.*)$ /lib/system/lib/font_awesome/lib/webfonts/$2;
rewrite ^sai$ /sai.php$1;
rewrite ^(.*)/files/([^/]+)/([^/]+)$ /api.php?call=files&cat=$2&id=$3;
rewrite ^/cache/([^/]+)/([^/]+)$ /api.php?call=cache&id=$1&ident=$2;
location / {
try_files $uri $uri/ =404;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
}

2
nginx/log/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore