Skip to content

Instantly share code, notes, and snippets.

@revsbech
Last active August 10, 2016 13:03
Show Gist options
  • Save revsbech/aebf15d0ce19fb8e3873f06784282a46 to your computer and use it in GitHub Desktop.
Save revsbech/aebf15d0ce19fb8e3873f06784282a46 to your computer and use it in GitHub Desktop.
application:
image: tianon/true
volumes:
- .:/var/www/myapp
mysql:
image: mariadb:10.1
ports:
- "3308:3306"
environment:
MYSQL_ROOT_PASSWORD:123
MYSQL_USER: myapp
MYSQL_PASSWORD: 123
MYSQL_DATABASE: myapp
nginx:
image: nginx:1.9
dns:
- 8.8.8.8
- 8.8.4.4
ports:
- "80:80"
links:
- php
volumes_from:
- application
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
php:
build: ./docker/php
dns:
- 8.8.8.8
- 8.8.4.4
links:
- mysql
volumes_from:
- application
server {
listen 80;
root /var/www/myapp/web;
server_name myapp;
location / {
# try to serve file directly, fallback to app.php
try_files $uri /index.php$is_args$args;
}
location ~ ^/.+\.php(/|$) {
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
FROM nginx:1.9
COPY ./ /var/www/myapp
COPY ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
FROM php:7-fpm
RUN apt-get update && apt-get install -y curl wget git zlib1g-dev libicu-dev g++
RUN echo 'date.timezone = Europe/Copenhagen' > /usr/local/etc/php/conf.d/date.ini
RUN touch /usr/local/etc/php/conf.d/xdebug.ini; \
echo xdebug.remote_enable=1 >> /usr/local/etc/php/conf.d/xdebug.ini; \
echo xdebug.remote_connect_back=1 >> /usr/local/etc/php/conf.d/xdebug.ini; \
echo xdebug.remote_port=9000 >> /usr/local/etc/php/conf.d/xdebug.ini;
RUN mkdir ~/software && \
cd ~/software/ && \
wget --no-check-certificate http://xdebug.org/files/xdebug-2.4.0rc4.tgz && \
tar -xvzf xdebug-2.4.0rc4.tgz && \
cd xdebug-2.4.0RC4 && \
phpize && \
./configure && \
make && \
cp modules/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20151012 && \
echo "zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so" >> /usr/local/etc/php/php.ini
RUN docker-php-ext-configure intl \
&& docker-php-ext-install pdo pdo_mysql zip intl
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment