Git Product home page Git Product logo

apache-php's Introduction

tutum-docker-php

Base docker image to run PHP applications on Apache

Building the base image

To create the base image tutum/apache-php, execute the following command on the tutum-docker-php folder:

docker build -t tutum/apache-php .

Running your Apache+PHP docker image

Start your image binding the external ports 80 in all interfaces to your container:

docker run -d -p 80:80 tutum/apache-php

Test your deployment:

curl http://localhost/

Hello world!

Enable .htaccess files

If you app uses .htaccess files you need to pass the ALLOW_OVERRIDE environment variable

docker run -d -p 80:80 -e ALLOW_OVERRIDE=true tutum/apache-php

Loading your custom PHP application

This image can be used as a base image for your PHP application. Create a new Dockerfile in your PHP application folder with the following contents:

FROM tutum/apache-php

After that, build the new Dockerfile:

docker build -t username/my-php-app .

And test it:

docker run -d -p 80:80 username/my-php-app

Test your deployment:

curl http://localhost/

That's it!

Loading your custom PHP application with composer requirements

Create a Dockerfile like the following:

FROM tutum/apache-php
RUN apt-get update && apt-get install -yq git && rm -rf /var/lib/apt/lists/*
RUN rm -fr /app
ADD . /app
RUN composer install
  • Replacing git with any dependencies that your composer packages might need.
  • Add your php application to /app

apache-php's People

Contributors

4giedrius avatar fermayo avatar icatalina avatar josephpage avatar maximeheckel avatar silentvick avatar tifayuki avatar

Watchers

 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.