Skip to content

Commit b29a4ed

Browse files
committed
add docker file
1 parent 0bc1316 commit b29a4ed

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

deploy/app.docker

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM php:7-fpm
2+
3+
RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client \
4+
&& docker-php-ext-install mcrypt pdo_mysql
5+
6+
WORKDIR /var/www

deploy/vhost.conf

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
server {
2+
listen 80;
3+
index index.php index.html;
4+
root /var/www/public;
5+
6+
location / {
7+
try_files $uri /index.php?$args;
8+
}
9+
10+
location ~ \.php$ {
11+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
12+
fastcgi_pass app:9000;
13+
fastcgi_index index.php;
14+
include fastcgi_params;
15+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
16+
fastcgi_param PATH_INFO $fastcgi_path_info;
17+
}
18+
}

deploy/web.docker

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM nginx:1.10
2+
3+
ADD ./deploy/vhost.conf /etc/nginx/conf.d/default.conf
4+
WORKDIR /var/www

docker-compose.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: '2'
2+
services:
3+
web:
4+
build:
5+
context: ./
6+
dockerfile: deploy/web.docker
7+
volumes:
8+
- ./:/var/www
9+
ports:
10+
- "8080:80"
11+
links:
12+
- app
13+
app:
14+
build:
15+
context: ./
16+
dockerfile: deploy/app.docker
17+
volumes:
18+
- ./:/var/www
19+
links:
20+
- database
21+
environment:
22+
- "DB_PORT=3306"
23+
- "DB_HOST=database"
24+
database:
25+
image: mysql:5.6
26+
environment:
27+
- "MYSQL_ROOT_PASSWORD=secret"
28+
- "MYSQL_DATABASE=filemanager"
29+
ports:
30+
- "33061:3306"

0 commit comments

Comments
 (0)