Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
sneezh committed Mar 10, 2020
0 parents commit 9e006af
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
APP_NAME=rbcparser
MYSQL_PORT=3307
NGINX_PORT=88
DATABASE_USER=root
DATABASE_NAME=rbc
DATABASE_PASSWORD=root
DATABASE_HOST=mysql
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
volumes/mysql
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3'
services:
nginx:
image: nginx:alpine
container_name: ${APP_NAME}_nginx
ports:
- ${NGINX_PORT}:80
volumes:
- ./volumes/nginx/default.conf:/etc/nginx/conf.d/default.conf:cached
- ./:/var/www/html:cached
php:
image: php:7.4-fpm
container_name: ${APP_NAME}_php
volumes:
- ./:/var/www/html:cached
mysql:
image: mysql:8
container_name: ${APP_NAME}_mysql
ports:
- ${MYSQL_PORT}:3306
volumes:
- ./volumes/mysql:/var/lib/mysql:cached
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=true
- MYSQL_DATABASE=${DATABASE_NAME}
- MYSQL_ROOT_PASSWORD=${DATABASE_PASSWORD}
4 changes: 4 additions & 0 deletions public/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

echo 'hi';

28 changes: 28 additions & 0 deletions volumes/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
server {
listen 80;
server_name 0.0.0.0;

root /var/www/html/public;
index index.php;

charset utf-8;

location / {
try_files $uri /index.php?$query_string;
}

location = /favicon.ico {
log_not_found off;
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

if ($request_uri ~ ^(.*/)index.(html|php)$) {
return 301 $scheme://$http_host$1;
}
}

0 comments on commit 9e006af

Please sign in to comment.