Skip to content

Instantly share code, notes, and snippets.

@steinkel
Last active October 2, 2019 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steinkel/7a4860e2721872a28d7f6158e5bf3d89 to your computer and use it in GitHub Desktop.
Save steinkel/7a4860e2721872a28d7f6158e5bf3d89 to your computer and use it in GitHub Desktop.
docker compose for cakephp and mysql
version: "3.1"
services:
mysql:
image: mysql:5.7
container_name: cakemysql
working_dir: /application
volumes:
- .:/application
- ./tmp/data/mysql_db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=my_app
- MYSQL_USER=my_app
- MYSQL_PASSWORD=secret
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
ports:
- "3306:3306"
php:
image: webdevops/php-apache:7.3
container_name: cakephp
working_dir: /application/webroot
volumes:
- ./:/application
environment:
- WEB_DOCUMENT_ROOT=/application/webroot
- DATABASE_URL=mysql://my_app:secret@cakemysql/my_app
ports:
- "80:80"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment