Docker for backend
This commit is contained in:
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
**/composer.lock
|
6
app/docker/PHP.Dockerfile
Normal file
6
app/docker/PHP.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
|
22
app/docker/nginx.conf
Normal file
22
app/docker/nginx.conf
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name money_app;
|
||||||
|
index index.php;
|
||||||
|
error_log /code/app/logs/error.log;
|
||||||
|
access_log /code/app/logs/access.log;
|
||||||
|
root /code/app/public;
|
||||||
|
|
||||||
|
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 app-php:9000;
|
||||||
|
}
|
||||||
|
}
|
47
docker-compose.yml
Normal file
47
docker-compose.yml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
app-server:
|
||||||
|
container_name: money_app
|
||||||
|
image: nginx:alpine
|
||||||
|
ports:
|
||||||
|
- 8081:80
|
||||||
|
volumes:
|
||||||
|
- .:/code
|
||||||
|
- ./app/docker/nginx.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
app-php:
|
||||||
|
container_name: money_app_php
|
||||||
|
build:
|
||||||
|
context: ./app/docker
|
||||||
|
dockerfile: PHP.Dockerfile
|
||||||
|
volumes:
|
||||||
|
- .:/code
|
||||||
|
ports:
|
||||||
|
- 9123:9000
|
||||||
|
|
||||||
|
db:
|
||||||
|
container_name: money_db
|
||||||
|
image: mariadb:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 3307:3306
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: 'money'
|
||||||
|
MYSQL_DATABASE: 'money_dev'
|
||||||
|
MYSQL_USER: 'money'
|
||||||
|
MYSQL_PASSWORD: 'money_pass'
|
||||||
|
volumes:
|
||||||
|
- dbdata:/var/lib/mysql
|
||||||
|
|
||||||
|
adminer:
|
||||||
|
container_name: money_adminer
|
||||||
|
image: adminer:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 8082:8080
|
||||||
|
environment:
|
||||||
|
ADMINER_DESIGN: 'dracula'
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
dbdata:
|
Reference in New Issue
Block a user