Skip to content

Commit

Permalink
add docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
albertcht committed Aug 21, 2017
1 parent 0bc1316 commit b29a4ed
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deploy/app.docker
@@ -0,0 +1,6 @@
FROM php:7-fpm

RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client \
&& docker-php-ext-install mcrypt pdo_mysql

WORKDIR /var/www
18 changes: 18 additions & 0 deletions deploy/vhost.conf
@@ -0,0 +1,18 @@
server {
listen 80;
index index.php index.html;
root /var/www/public;

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

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
4 changes: 4 additions & 0 deletions deploy/web.docker
@@ -0,0 +1,4 @@
FROM nginx:1.10

ADD ./deploy/vhost.conf /etc/nginx/conf.d/default.conf
WORKDIR /var/www
30 changes: 30 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,30 @@
version: '2'
services:
web:
build:
context: ./
dockerfile: deploy/web.docker
volumes:
- ./:/var/www
ports:
- "8080:80"
links:
- app
app:
build:
context: ./
dockerfile: deploy/app.docker
volumes:
- ./:/var/www
links:
- database
environment:
- "DB_PORT=3306"
- "DB_HOST=database"
database:
image: mysql:5.6
environment:
- "MYSQL_ROOT_PASSWORD=secret"
- "MYSQL_DATABASE=filemanager"
ports:
- "33061:3306"

0 comments on commit b29a4ed

Please sign in to comment.