Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/helloandre/cakephp-docker-compose
a one-stop-shop to get cakephp up and running with docker-compose
https://github.com/helloandre/cakephp-docker-compose
cakephp docker-compose
Last synced: 26 days ago
JSON representation
a one-stop-shop to get cakephp up and running with docker-compose
- Host: GitHub
- URL: https://github.com/helloandre/cakephp-docker-compose
- Owner: helloandre
- Created: 2017-06-09T03:22:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-09T03:23:50.000Z (over 7 years ago)
- Last Synced: 2024-10-27T17:30:39.979Z (2 months ago)
- Topics: cakephp, docker-compose
- Language: Nginx
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CakePHP and Docker Compose
This repo aims to be a one-stop-shop for getting cakephp up and running quickly with docker compose.
### prerequisites
- [docker compose](https://docs.docker.com/compose/)
- [composer](https://getcomposer.org/) (either installed locally or globally### install
this will get the repo, install a blank cakephp, make a mysql-writable directory, and add a value to your `/etc/hosts` file so it is reachable.
```
git clone https://github.com/helloandre/cakephp-docker-compose
cd cakephp-docker-compose
composer create-project -q -n --prefer-dist cakephp/app cakephp/www
mkdir -p mysql/data
echo '127.0.0.1 cakephp.dev' | sudo tee -a /etc/hosts > /dev/null
```### running
this will build the docker containers and start them.
`docker-compose up`
### database
your application will be available at `http://cakephp.dev:8080`. At first CakePHP will not be able to connect to the database, so you must update the values in `config/app.php`.
```
'Datasources' => [
'default' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
// docker-compose manages this host
'host' => 'cakephp_mysql_1',
// defaults as set in docker-compose.yml
'username' => 'cakephp',
'password' => 'cakephp_password',
'database' => 'cakephp',
'encoding' => 'utf8',
'timezone' => 'UTC',
'flags' => [],
'cacheMetadata' => true,
'log' => false,
'quoteIdentifiers' => false,
'url' => env('DATABASE_URL', null),
],
],
```if you wish to use any different credententials, you can change the values in `docker-compose.yml` and either connect to the container and change the values manually or (the nuclear apporach) delete the `mysql/data` directory.
### TODO
- `bootstrap.sh` for easier setup/config
- caching with `memcached`