Last active
March 25, 2016 04:44
-
-
Save aimakun/d826e72667bf1982face to your computer and use it in GitHub Desktop.
Sample for docker-compose.yml & Dockerfile used in development environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2' | |
| services: | |
| web: | |
| build: | |
| context: ./docker | |
| dockerfile: Dockerfile-web | |
| ports: | |
| - "80:80" | |
| volumes_from: | |
| - data | |
| environment: | |
| MYSQL_HOST: db # env variable to easy for change named services later | |
| extra_hosts: | |
| - "mysite.local:127.0.0.1" # Setup for self service eg. wkhtmltopdf | |
| db: | |
| image: aimakun/mysql | |
| ports: | |
| - "3306:3306" | |
| environment: | |
| MYSQL_DATABASE: mysite_dev | |
| MYSQL_ROOT_PASSWORD: root | |
| scripts: | |
| build: | |
| context: ./docker | |
| dockerfile: Dockerfile-scripts | |
| volumes_from: | |
| - data | |
| data: | |
| image: busybox | |
| volumes: | |
| - .:/data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM digitallyseamless/nodejs-bower-grunt | |
| COPY . /data | |
| WORKDIR /data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM parana/trusty-php | |
| COPY docker-vhosts.conf /etc/apache2/sites-enabled/000-default.conf | |
| # Set timezone | |
| RUN echo 'date.timezone = Asia/Bangkok' > /etc/php5/apache2/php.ini | |
| # Required extensions for this project | |
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
| software-properties-common php5-mcrypt php-soap php5-intl \ | |
| libcurl3 php5-curl gettext \ | |
| && php5enmod mcrypt \ | |
| && php5enmod soap | |
| # Install wkhtmltopdf | |
| RUN add-apt-repository ppa:ecometrica/servers \ | |
| && apt-get update \ | |
| && DEBIAN_FRONTEND=noninteractive apt-get install -y xvfb wkhtmltopdf | |
| # Setup locale & timezone | |
| RUN locale-gen sv_SE.UTF-8 | |
| RUN locale-gen en_US.UTF-8 | |
| # Install PHPUnit 4.8 for variety of PHP versions | |
| RUN wget https://phar.phpunit.de/phpunit-old.phar | |
| RUN chmod +x phpunit-old.phar | |
| RUN mv phpunit-old.phar /usr/local/bin/phpunit | |
| # Set default volume for image | |
| # This would be overrided by docker-compose for updatable source code between development | |
| COPY . /data | |
| WORKDIR /data | |
| # Fixes user permissions for Mac OS [https://github.com/boot2docker/boot2docker/issues/581] | |
| RUN usermod -u 1000 www-data | |
| RUN usermod -G staff www-data | |
| RUN apache2 -D FOREGROUND & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment