GithubHelp home page GithubHelp logo

vooders / docker-cakephp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dynamictivity/docker-cakephp

0.0 2.0 0.0 113 KB

Run a CakePHP application using Docker & docker-compose

Home Page: https://gitlab.dynamictivity.com/dynamictivity/docker-cakephp

License: Other

Nginx 3.38% PHP 88.17% Shell 8.45%

docker-cakephp's Introduction

docker-cakephp

Just a little Docker POC in order to have a complete stack for running CakePHP into Docker containers using docker-compose tool. It is recommended to utilize this stack with database sessions, so your sessions can be persisted across all running instances of your application.

Contributing

Please see Contributing for instructions on contributing to this repository.

Features

Installed Packages

netcat
unzip
php
php-sqlite3
php-pear
php-ldap
php-pgsql
php-mcrypt
php-mbstring
php-gmp
php-json
php-mysql
php-gd
php-odbc
php-xmlrpc
php-memcache
php-curl
php-imagick
php-intl
php-fpm
git
curl
wget

Todo

  • Get database sessions working (currently it always creates the data field of the sessions table as binary(255) no-matter what)
  • Suggestions?

Installation

First, clone this repository:

$ git clone [email protected]:Dynamictivity/docker-cakephp.git

Next, edit the docker-compose.yml file and change the REPO: value to the URL of your application's GIT repository.

Finally (required only for SSH GIT repositories), edit php-fpm/id_rsa file and put your GIT deployment (private key) in there so that the docker container can access your private GIT repository. If you are using GIT via SSH you'll also want to change the REPO_HOST: value to the FQDN of your GIT server host, that way the host key can be automatically accepted.

Then, run:

$ docker-compose up

You are done, you can visit your CakePHP application on the following URL: http://localhost

Note : you can rebuild all Docker images by running:

$ docker-compose build

Custom Application Configuration

Database Migrations and Seeds

When the container spins up it runs the following 2 commands (aside from composer install):

$ cd /www; bin/cake migrations migrate
$ cd /www; bin/cake migrations seed --seed $DB_SEED

You can specify the database seed file inside of docker-compose.yml by changing the DB_SEED: value to that of your database seed file.

E-Mail Configuration

Change the following variables in docker-compose.yml to configure email in your application:

EMAIL_HOST: 'localhost'
EMAIL_PORT: '25'
EMAIL_TIMEOUT: '30'
EMAIL_USERNAME: 'user'
EMAIL_PASSWORD: 'secret'
EMAIL_TLS:

Vagrant

You can also use vagrant for testing by typing the following command from the work tree: vagrant up

Run the following commands:

$ cd /vagrant
$ docker-compose up

How it works?

Here are the docker-compose built images:

  • db: This is the MySQL database container (can be changed to postgresql or whatever in docker-compose.yml file)
  • nginx: This is the Nginx webserver container in which php volumes are mounted to
  • php: This is the PHP-FPM container including the application volume mounted on

This results in the following running containers:

> $ docker-compose ps
        Name                      Command               State              Ports
        -------------------------------------------------------------------------------------------
        docker_db_1            /entrypoint.sh mysqld            Up      0.0.0.0:3306->3306/tcp
        docker_nginx_1         nginx                            Up      443/tcp, 0.0.0.0:80->80/tcp
        docker_php_1           php5-fpm -F                      Up      9000/tcp

Read logs

You can access Nginx and CakePHP application logs in the following directories on your host machine:

  • logs/nginx
  • logs/cakephp

Code license

You are free to use the code in this repository under the terms of the 0-clause BSD license. LICENSE contains a copy of this license.

docker-cakephp's People

Contributors

akovalyov avatar b-galati avatar eko avatar mickadoo avatar phpeek avatar samsch avatar theaxiom avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.