GithubHelp home page GithubHelp logo

snypelife / apache-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chriswayg/apache-php

0.0 1.0 0.0 15 KB

:whale: Docker image with Apache2.4 web server with PHP 5.6 based on the official Debian Jessie image

Home Page: https://hub.docker.com/r/chriswayg/apache-php/

License: GNU General Public License v2.0

Shell 100.00%

apache-php's Introduction

apache-php for Docker

Docker image with Apache2 web server and PHP based on the official Debian Jessie image

  • Apache 2.4 web server
  • HTTPS/SSL enabled
  • PHP 7
  • logging enabled
  • all original Debian Packages (not compiled from source)
  • this image automatically updates on Docker Hub, each time the Debian image is updated

Apache

The Apache HTTP Server, colloquially called Apache, is a Web server application notable for playing a key role in the initial growth of the World Wide Web. Originally based on the NCSA HTTPd server, development of Apache began in early 1995 after work on the NCSA code stalled. Apache quickly overtook NCSA HTTPd as the dominant HTTP server, and has remained the most popular HTTP server in use since April 1996.

wikipedia.org/wiki/Apache_HTTP_Server

logo

PHP

PHP is a server-side scripting language designed for web development, but which can also be used as a general-purpose programming language. PHP can be added to straight HTML or it can be used with a variety of templating engines and web frameworks. PHP code is usually processed by an interpreter, which is here implemented as a native module. Apache and PHP requires preforking Apache for best results.

wikipedia.org/wiki/PHP

logo

Quickstart:

Example with host mount:

mkdir -p html && echo "<?php phpinfo(); ?>" > html/index.php

docker run -d --name=apache-php \
--restart=always \
-p 80:80 -p 443:443 \
-v "$PWD/html":/var/www/html \
snypelife/apache-php

Alternatively create a Dockerfile for your project

The ./html/ directory contains all your php files and the ./config/ directory contains your php.ini file. It is recommended to add a custom php.ini configuration. COPY it into /etc/php5/apache2/.

Dockerfile

FROM snypelife/apache-php
COPY ./html/ /var/www/html/
COPY ./config/php.ini /etc/php7.0/apache2/

Then, run the commands to build and run the Docker image:

docker build -t my-php-site .
docker run -d --name=my-php-site_1 -p 80:80 -p 443:443 my-php-site
docker logs my-php-site_1

SSL Certificate & Key

By default, Apache will use the Debian generated "snakeoil" key when serving SSL. Obviously this isn't sufficient or advisable for production, so you'll want to mount or copy a real certificate into /etc/ssl/certs/ and the coreesponding key into /etc/ssl/private/. Edit default-ssl.conf to include the paths to your new cert and key and mount or copy it into /etc/apache2/sites-available/ If you don't want to use SSL, you don't need to forward port 443 when running the container.

Directories with important data:

Copy or mount needed data for these directories as described above or use Data Volume Containers to store the data.

  • Webroot: /var/www/html/
  • Apache2 config: /etc/apache2/
  • SSL: /etc/ssl/
  • PHP: /etc/php7.0/apache2/php.ini

Used by Concrete5.7 CMS Docker Image

See how this image is used as the base of my Concrete5.7 CMS Docker Image and the corresponding Github repository here: https://github.com/snypelife/concrete5.7


License:

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

apache-php's People

Contributors

chriswayg avatar snypelife 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.