Last active
December 6, 2017 15:32
-
-
Save acro5piano/7b330ce17a69c9e8aadb9c228fcd5408 to your computer and use it in GitHub Desktop.
Docker Composeで手軽に開発環境を構築 (PHP+MySQL+Elasticsearch+Memcached) ref: https://qiita.com/acro5piano/items/1d907f81afd0fb3a199e
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
web: | |
container_name: some-web |
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
elasticsearch: | |
image: "elasticsearch:1.3" | |
memcached: | |
image: memcached |
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 mysql:5.6 | |
COPY my.cnf /etc/mysql |
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
git clone https://github.com/acro5piano/docker-lamp-elasticsearch.git | |
cd docker-lamp-elasticsearch | |
docker-compose up |
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
. | |
|-- db | |
| |-- init.d | |
| | `-- setup.sql | |
| |-- Dockerfile | |
| `-- my.cnf | |
|-- src | |
| `-- yourgreatapp | |
| `-- index.php | |
|-- web | |
| |-- Dockerfile | |
| `-- httpd.conf | |
`-- docker-compose.yml |
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
[mysqld] | |
default-storage-engine=InnoDB | |
character-set-server=utf8 |
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
GRANT ALL PRIVILEGES ON `yourgreatapp`.* TO 'yourgreatapptest'@'%'; |
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
Name Command State Ports | |
-------------------------------------------------------------------------------------------------------------- | |
docker_db_1 docker-entrypoint.sh mysqld Up 0.0.0.0:33333->3306/tcp | |
docker_elasticsearch_1 /docker-entrypoint.sh elas ... Up 9200/tcp, 9300/tcp | |
docker_memcached_1 docker-entrypoint.sh memcached Up 11211/tcp | |
docker_web_1 /usr/sbin/apachectl -D FOR ... Up 0.0.0.0:3000->3000/tcp, 0.0.0.0:8000->80/tcp |
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
elasticsearch: | |
image: "elasticsearch:1.3" | |
memcached: | |
image: memcached |
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
Name Command State Ports | |
-------------------------------------------------------------------------------------------------------------- | |
docker_db_1 docker-entrypoint.sh mysqld Up 0.0.0.0:33333->3306/tcp | |
docker_elasticsearch_1 /docker-entrypoint.sh elas ... Up 9200/tcp, 9300/tcp | |
docker_memcached_1 docker-entrypoint.sh memcached Up 11211/tcp | |
docker_web_1 /usr/sbin/apachectl -D FOR ... Up 0.0.0.0:3000->3000/tcp, 0.0.0.0:8000->80/tcp |
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
alias dc='docker-compose' |
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
web: | |
container_name: some-web |
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
alias dc='docker-compose' |
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
dc run web php /var/www/app/composer.phar update |
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
web: | |
build: ./web | |
ports: | |
- "8000:80" | |
- "3000:3000" | |
links: | |
- db | |
- memcached | |
- elasticsearch | |
volumes: | |
- ./src/yourgreatapp:/var/www/yourgreatapp | |
db: | |
build: ./db | |
environment: | |
MYSQL_ROOT_PASSWORD: ROOT_PASSWORD | |
MYSQL_DATABASE: yourgreatapp | |
MYSQL_USER: yourgreatapptest | |
MYSQL_PASSWORD: yourgreatapptest | |
MYSQL_HOST: "" | |
mem_limit: 1000000000 | |
volumes: | |
- ./db/init.d:/docker-entrypoint-initdb.d | |
ports: | |
- "33333:3306" | |
elasticsearch: | |
image: "elasticsearch:1.3" | |
memcached: | |
image: memcached |
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
|-- src | |
| `-- yourgreatapp | |
| `-- index.php | |
`-- web | |
|-- init.d | |
| `-- setup.sh | |
|-- Dockerfile | |
`-- httpd.conf |
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 centos:6 | |
RUN rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
RUN rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm | |
RUN yum install -y httpd | |
RUN yum install --enablerepo=epel,remi-php55,remi -y \ | |
php \ | |
php-cli \ | |
php-gd \ | |
php-mbstring \ | |
php-mcrypt \ | |
php-mysqlnd \ | |
php-pdo \ | |
php-xml \ | |
php-xdebug \ | |
php-memcached | |
RUN sed -i -e "s|^;date.timezone =.*$|date.timezone = Asia/Tokyo|" /etc/php.ini | |
COPY httpd.conf /etc/httpd/conf.d/yourgreatapp.conf | |
EXPOSE 80 | |
CMD ["/usr/sbin/apachectl", "-D", "FOREGROUND"] |
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
NameVirtualHost *:80 | |
<VirtualHost *:80> | |
ServerName docker-compose-lamp.dev | |
DocumentRoot /var/www/yourgreatapp/public | |
<Directory /var/www/yourgreatapp/public> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride all | |
Order allow,deny | |
allow from all | |
</Directory> | |
SetEnv FUEL_ENV development_docker | |
</VirtualHost> |
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
|-- db | |
|-- init.d | |
| `-- setup.sql | |
|-- Dockerfile | |
`-- my.cnf |
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 mysql:5.6 | |
COPY my.cnf /etc/mysql |
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
|-- db | |
|-- init.d | |
| `-- setup.sql | |
|-- Dockerfile | |
`-- my.cnf |
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
GRANT ALL PRIVILEGES ON `yourgreatapp`.* TO 'yourgreatapptest'@'%'; |
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 mysql:5.6 | |
COPY my.cnf /etc/mysql |
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
NameVirtualHost *:80 | |
<VirtualHost *:80> | |
ServerName docker-compose-lamp.dev | |
DocumentRoot /var/www/yourgreatapp/public | |
<Directory /var/www/yourgreatapp/public> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride all | |
Order allow,deny | |
allow from all | |
</Directory> | |
SetEnv FUEL_ENV development_docker | |
</VirtualHost> |
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
<?php phpinfo(); |
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
[mysqld] | |
default-storage-engine=InnoDB | |
character-set-server=utf8 |
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
GRANT ALL PRIVILEGES ON `yourgreatapp`.* TO 'yourgreatapp'@'%'; |
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
|-- src | |
| `-- yourgreatapp | |
| `-- index.php | |
`-- web | |
|-- init.d | |
| `-- setup.sh | |
|-- Dockerfile | |
`-- httpd.conf |
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
hogehoge/fugafuga.git | |
|-- public/index.php | |
|-- docker-compose.yml | |
`-- docker | |
|-- web | |
| `-- Dockerfile | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment