-
-
Save arodu/9b37ec3e7377d74b31941aeb4f5d41bd to your computer and use it in GitHub Desktop.
CakePHP docker setup
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: | |
cakephp-mysql: | |
image: mysql:5.7 | |
container_name: cakephp-mysql | |
working_dir: /application | |
command: mysqld --sql-mode='NO_ENGINE_SUBSTITUTION' --character-set-server=utf8 --init-connect='SET NAMES UTF8;' | |
environment: | |
- MYSQL_USER=my_app | |
- MYSQL_PASSWORD=secret | |
- MYSQL_ROOT_PASSWORD=password | |
- MYSQL_DATABASE=cakephp | |
volumes: | |
- ./:/application | |
- ./mysql-data:/var/lib/mysql | |
#- ./docker/wwis-mysql:/docker-entrypoint-initdb.d | |
ports: | |
- '3811:3306' | |
cakephp: | |
image: webdevops/php-apache:8.0 | |
container_name: cakephp | |
working_dir: /application/webroot | |
volumes: | |
- ./:/application | |
- ~/.ssh:/home/application/.ssh:ro | |
environment: | |
WEB_DOCUMENT_ROOT: /application/webroot | |
DATABASE_URL: mysql://root:password@cakephp-mysql:3306/cakephp | |
DATABASE_TEST_URL: mysql://root:password@cakephp-mysql:3306/cakephp_test | |
ports: | |
- "8811:80" |
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
## DO NOT USE THESE VALUES ON PRODUCTION | |
## ONLY USE THIS FOR YOUR LOCAL ENVIRONMENT | |
MYSQL_ROOT_PASSWORD=password | |
MYSQL_DATABASE=my_app | |
MYSQL_USER=my_user | |
MYSQL_PASSWORD=password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment