Skip to content

Instantly share code, notes, and snippets.

@arodu
Forked from rochamarcelo/docker-compose.yml
Last active August 6, 2022 15:51
Show Gist options
  • Save arodu/9b37ec3e7377d74b31941aeb4f5d41bd to your computer and use it in GitHub Desktop.
Save arodu/9b37ec3e7377d74b31941aeb4f5d41bd to your computer and use it in GitHub Desktop.
CakePHP docker setup
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"
## 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