Coder Social home page Coder Social logo

jkeiski / docker-zf2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from octavianparalescu/docker-zf2

0.0 0.0 0.0 18 KB

Example for quickly running ZF2 Applications within a docker container

Home Page: https://registry.hub.docker.com/u/maglnet/docker-zf2/

License: MIT License

Dockerfile 47.55% Shell 52.45%

docker-zf2's Introduction

Docker and Zend Framework 2

Here you'll find a Dockerfile and some configurations to run your Zend Framework 2 applications within a docker container.

Although this image has configurations for production environments included, it's main purpose is to quickly start developing a ZF2 application.
If you decide to use this image for setting up a production environment, be sure to excessively test if your application runs without problems in this environment and also change the exposed port in the Dockerfile from 8085 (or whatever port you used for your app on dev) to 80.

Features

  • PHP 5.6 including multiple extensions (see Dockerfile)
  • Apache 2.4 including mod_rewrite
  • Config for DEV and PROD (not recommended) usage
    • DEV
      • xdebug configured with remote_connect_back
    • PROD
      • opcache with recommended settings for performance
      • xdebug extension disabled by default

Running your ZF2 application in Docker

New project

cd /home/user/new-zf2-app
composer create-project --stability="dev" zendframework/skeleton-application .
sudo docker run -d -p 8085:80 -v $(pwd):/zf2-app octavianparalescu/docker-zf2

Now visit http://localhost:8085 and check out your running Zend Skeleton Application.

Existing project

cd /home/user/your-zf2-app
sudo docker run -d -p 8085:80 -v $(pwd):/zf2-app octavianparalescu/docker-zf2

Using Docker for Windows

Docker for Windows should run like Docker for Mac or Linux. The difference in this case would be that you should replace the env var "$(pwd)" in the docker run command with the counterpart in Windows "%cd%" and also remove the "sudo" part.

Options / environment variables to fine tune the config

docker run \
    -e DOCKER_ZF2_ENV="DEV" \ # DEV|PROD copies dev or prod config to /etc (default:DEV)
    -e PHP_MODS_DISABLE="xdebug sqlite" # explicitly disable php modules (space separated list of modules)
    -e PHP_MODS_ENABLE="mysql opcache" # explicitly enable php modules (space separated list of modules)

Contributing

Feel free to open issues or fork and create a PR. This is as well forked from https://github.com/maglnet/docker-zf2 which is a bit outdated.

License

docker-zf2 is licensed under the MIT license. See the included LICENSE file.

docker-zf2's People

Contributors

maglnet 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.