Skip to content

Instantly share code, notes, and snippets.

Created January 2, 2017 11:02
Show Gist options
  • Save anonymous/a13cf604981726c8e8b0bb05a35664e2 to your computer and use it in GitHub Desktop.
Save anonymous/a13cf604981726c8e8b0bb05a35664e2 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Jan 2, 2017.
    7 changes: 7 additions & 0 deletions app.dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    FROM php:7.0.4-fpm

    RUN apt-get update && apt-get install -y libmcrypt-dev \
    mysql-client libmagickwand-dev --no-install-recommends \
    && pecl install imagick \
    && docker-php-ext-enable imagick \
    && docker-php-ext-install mcrypt pdo_mysql
    40 changes: 40 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    version: '2'
    services:

    # The Application
    app:
    build:
    context: ./
    dockerfile: app.dockerfile
    working_dir: /var/www
    volumes:
    - ./:/var/www
    environment:
    - "DB_PORT=3306"
    - "DB_HOST=database"

    # The Web Server
    web:
    build:
    context: ./
    dockerfile: web.dockerfile
    working_dir: /var/www
    volumes_from:
    - app
    ports:
    - 8080:80

    # The Database
    database:
    image: mysql:5.6
    volumes:
    - dbdata:/var/lib/mysql
    environment:
    - "MYSQL_ROOT_PASSWORD=secret"
    - "MYSQL_DATABASE=homestead"
    - "MYSQL_USER=homestead"
    ports:
    - "33061:3306"

    volumes:
    dbdata:
    18 changes: 18 additions & 0 deletions vhost.conf
    Original file line number Diff line number Diff line change
    @@ -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;
    }
    }
    3 changes: 3 additions & 0 deletions web.dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    FROM nginx:1.10

    ADD vhost.conf /etc/nginx/conf.d/default.conf