add docker support
This commit is contained in:
parent
da1693b508
commit
dfaecb84e0
37
docker-compose.yml
Normal file
37
docker-compose.yml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
version: "3.4"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mariadb:
|
||||||
|
build:
|
||||||
|
context: ./docker
|
||||||
|
dockerfile: ./Dockerfile.mariadb
|
||||||
|
environment:
|
||||||
|
- MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1
|
||||||
|
- MARIADB_USER=root
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
volumes:
|
||||||
|
- db_vol:/var/lib/mysql
|
||||||
|
|
||||||
|
php:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./docker/Dockerfile.php
|
||||||
|
volumes:
|
||||||
|
- ./:/app
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./docker/Dockerfile.nginx
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
- mariadb
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
volumes:
|
||||||
|
- ./nginx/log:/var/log/nginx
|
||||||
|
- ./:/app
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db_vol:
|
||||||
1
docker/Dockerfile.mariadb
Normal file
1
docker/Dockerfile.mariadb
Normal file
@ -0,0 +1 @@
|
|||||||
|
FROM mariadb:latest
|
||||||
3
docker/Dockerfile.nginx
Normal file
3
docker/Dockerfile.nginx
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM nginx:latest
|
||||||
|
|
||||||
|
COPY ../nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||||
4
docker/Dockerfile.php
Normal file
4
docker/Dockerfile.php
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM php:8.2-fpm
|
||||||
|
|
||||||
|
# RUN docker-php-ext-install pdo pdo_mysql mbstring
|
||||||
|
RUN docker-php-ext-install session mysqli
|
||||||
17
nginx/default.conf
Normal file
17
nginx/default.conf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
listen [::]:80 default_server;
|
||||||
|
|
||||||
|
root /app;
|
||||||
|
index index.php;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
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 PATH_INFO $fastcgi_path_info;
|
||||||
|
}
|
||||||
|
}
|
||||||
2
nginx/log/.gitignore
vendored
Normal file
2
nginx/log/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
Loading…
x
Reference in New Issue
Block a user