Docker
This commit is contained in:
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM php:7.4-fpm
|
||||||
|
|
||||||
|
RUN docker-php-ext-install pdo pdo_mysql
|
||||||
|
|
||||||
|
RUN pecl install xdebug-3.0.3 \
|
||||||
|
&& docker-php-ext-enable xdebug
|
46
docker-compose.yml
Normal file
46
docker-compose.yml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
image: nginx:alpine
|
||||||
|
container_name: web
|
||||||
|
ports:
|
||||||
|
- 8080:80
|
||||||
|
volumes:
|
||||||
|
- .:/code
|
||||||
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
php:
|
||||||
|
build: .
|
||||||
|
container_name: php
|
||||||
|
ports:
|
||||||
|
- 9123:9000
|
||||||
|
volumes:
|
||||||
|
- .:/code
|
||||||
|
|
||||||
|
db:
|
||||||
|
container_name: db
|
||||||
|
image: mariadb:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 3307:3306
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: 'password'
|
||||||
|
MYSQL_DATABASE: 'incoviba'
|
||||||
|
MYSQL_USER: 'incoviba'
|
||||||
|
MYSQL_PASSWORD: '5GQYFvRjVw2A4KcD'
|
||||||
|
volumes:
|
||||||
|
- dbdata:/var/lib/mysql
|
||||||
|
|
||||||
|
adminer:
|
||||||
|
container_name: adminer
|
||||||
|
image: adminer:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 8082:8080
|
||||||
|
environment:
|
||||||
|
ADMINER_DESIGN: 'dracula'
|
||||||
|
ADMINER_PLUGINS: 'dump-json'
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
dbdata:
|
25
nginx.conf
Normal file
25
nginx.conf
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name web;
|
||||||
|
index index.php;
|
||||||
|
error_log /code/logs/error.log;
|
||||||
|
access_log /code/logs/access.log;
|
||||||
|
root /code/public;
|
||||||
|
|
||||||
|
location /api {
|
||||||
|
try_files $uri /api/index.php$is_args$args;
|
||||||
|
}
|
||||||
|
location / {
|
||||||
|
try_files $uri /index.php$is_args$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php {
|
||||||
|
try_files $uri =404;
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
fastcgi_pass php:9000;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user