Initial commit with basic LEMP stack
This commit is contained in:
commit
7b556a55dd
5 changed files with 100 additions and 0 deletions
48
docker-compose.yaml
Normal file
48
docker-compose.yaml
Normal file
|
@ -0,0 +1,48 @@
|
|||
nginx:
|
||||
build: ./nginx/
|
||||
ports:
|
||||
- 80:80
|
||||
links:
|
||||
- php
|
||||
volumes_from:
|
||||
- app
|
||||
|
||||
php:
|
||||
build: ./php/
|
||||
expose:
|
||||
- 9000
|
||||
links:
|
||||
- mysql
|
||||
volumes_from:
|
||||
- app
|
||||
|
||||
app:
|
||||
image: php:7.0-fpm
|
||||
volumes:
|
||||
- ./public_html:/var/www/html
|
||||
command: "true"
|
||||
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
volumes_from:
|
||||
- data
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
MYSQL_DATABASE: project
|
||||
MYSQL_USER: project
|
||||
MYSQL_PASSWORD: project
|
||||
|
||||
data:
|
||||
image: mysql:latest
|
||||
volumes:
|
||||
- /var/lib/mysql
|
||||
command: "true"
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin
|
||||
ports:
|
||||
- 8080:80
|
||||
links:
|
||||
- mysql
|
||||
environment:
|
||||
PMA_HOST: mysql
|
3
nginx/Dockerfile
Normal file
3
nginx/Dockerfile
Normal file
|
@ -0,0 +1,3 @@
|
|||
FROM nginx:latest
|
||||
|
||||
COPY ./default.cnf /etc/nginx/conf.d/default.conf
|
36
nginx/default.cnf
Normal file
36
nginx/default.cnf
Normal file
|
@ -0,0 +1,36 @@
|
|||
server {
|
||||
listen 80 default_server;
|
||||
root /var/www/html;
|
||||
index index.html index.php;
|
||||
|
||||
charset utf-8;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
|
||||
access_log off;
|
||||
error_log /var/log/nginx/error.log error;
|
||||
|
||||
sendfile off;
|
||||
|
||||
client_max_body_size 100m;
|
||||
|
||||
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_intercept_errors off;
|
||||
fastcgi_buffer_size 16k;
|
||||
fastcgi_buffers 4 16k;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
}
|
3
php/Dockerfile
Normal file
3
php/Dockerfile
Normal file
|
@ -0,0 +1,3 @@
|
|||
FROM php:7.0-fpm
|
||||
|
||||
RUN docker-php-ext-install pdo_mysql
|
10
public_html/index.php
Normal file
10
public_html/index.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Hello World!</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>You're all set, get to coding!</h1>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue