Last active
October 2, 2019 08:20
-
-
Save steinkel/7a4860e2721872a28d7f6158e5bf3d89 to your computer and use it in GitHub Desktop.
docker compose for cakephp and mysql
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.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