Last active
September 22, 2016 03:36
-
-
Save acro5piano/c5ab7084fbc75851983d925fad26bade to your computer and use it in GitHub Desktop.
Docker Composeで手軽に開発環境を構築 (すっきりPHPなど) ref: http://qiita.com/acro5piano/items/ac3bef8a9f8bb9fdbdd5
This file contains 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: ./docker/web | |
ports: | |
- "3000:3000" | |
links: | |
- db | |
- memcached | |
- elasticsearch | |
volumes: | |
- ./:/code | |
working_dir: /code | |
command: php -S 0.0.0.0:3000 | |
container_name: some-web | |
db: | |
image: "mysql:5.7" | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: app | |
MYSQL_HOST: "" | |
# If you want to set mysql user manually, remove these comments: | |
#MYSQL_USER: user | |
#MYSQL_PASSWORD: password | |
mem_limit: 1000000000 | |
container_name: some-db | |
elasticsearch: | |
image: "elasticsearch:2.4" | |
container_name: some-elasticsearch | |
memcached: | |
image: "memcached:1.4" | |
container_name: some-memcached |
This file contains 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 php:7.0 | |
RUN apt-get update | |
RUN apt-get install -y zlib1g-dev libjpeg-dev libpng-dev libfreetype6-dev | |
RUN docker-php-ext-install pdo_mysql | |
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ | |
RUN docker-php-ext-install gd | |
RUN docker-php-ext-install mysqli |
This file contains 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
git clone https://github.com/acro5piano/docker-compose-dev-env.git | |
cd docker-compose-dev-env | |
docker-compose up |
This file contains 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
alias dc='docker-compose' | |
alias de='docker exec -it' |
This file contains 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
. | |
|-- docker | |
| |-- web | |
| | `-- Dockerfile | |
| `-- db | |
| |-- Dockerfile | |
| `-- my.cnf | |
|-- docker-compose.yml | |
|-- index.php | |
`-- README.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment