Last active
July 11, 2019 09:43
-
-
Save Kazunari-h/3a8de9346ca711f727a8a7c7afe7c615 to your computer and use it in GitHub Desktop.
XAMPやMAMPを頼らず、自分のローカル開発環境を作る。
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: "3" | |
services: | |
nginx: | |
image: nginx:latest | |
ports: | |
- 8080:80 | |
volumes: | |
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf | |
- ./www/html:/var/www/html | |
depends_on: | |
- php | |
php: | |
build: ./php | |
volumes: | |
- ./www/html:/var/www/html | |
depends_on: | |
- db | |
db: | |
image: mysql:5.7 | |
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci | |
ports: | |
- 13306:3306 | |
volumes: | |
- ./mysql/data:/var/lib/mysql | |
environment: | |
MYSQL_ROOT_PASSWORD: secret | |
phpmyadmin: | |
image: phpmyadmin/phpmyadmin:latest | |
ports: | |
- 8888:80 | |
depends_on: | |
- db |
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.2-fpm | |
RUN docker-php-ext-install pdo_mysql | |
COPY php.ini /usr/local/etc/php/ |
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
server { | |
listen 80; | |
server_name _; | |
root /var/www/html; | |
index index.php index.html; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
location ~ \.php$ { | |
fastcgi_pass php:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} |
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
date.timezone = "Asia/Tokyo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment