Giter Club home page Giter Club logo

apache's Introduction

Apache Docker

Run Status Circle CI Beerpay Beerpay

This repo will give you a turn key Docker container build for use in production OR local development. The setup includes an Apache web service, PHP 7.3, PHP Composer, linked MySQL 5.7.26 instance and a data container volume.

In this repo you will find a number of complete Dockerfile builds used in development and production environments. Listed below is an explanation of each file. Ask a question!

Dependencies


Build Breakdown

Apache                       # → Root of Docker Build
├── app/                     # → App conf to manage application on container
│   ├── apache-config.conf   # → Default Apache config
│   ├── index.php            # → Default web page, enter the IP `docker-machine ls` to load this page.
│   ├── mac-permissions.sh   # → Run manually on container to match uid / gid permissions of local docker container to Mac OS X
│   ├── postfix.sh           # → Used by *supervisord.conf* to start Postfix
│   ├── run.sh               # → Setup apache, conf files, and start process on container
│   ├── sample.conf          # → located within `/data/apache2/sites-enabled` duplicate / modify to host others domains
│   └── supervisord          # → Supervisor is a client / server system which monitors and controls a number of processes on UNIX-like operating systems
├── .env.example             # → Rename file to `.env` for local environment variables used within build
├── .circleci/               # → CircleCI 2.0
│   └── config.yml           # → CircleCI Config
├── docker-compose.local.yml # → Local build 
├── docker-compose.yml       # → Production build
├── Dockerfile               # → Uses a basefile build to help speed up the docker container build process
├── Makefile                 # → Build command shortcuts
├── shippable.yml            # → Configuration for Shippable.com testing
└── tests/
	└── build_tests.sh       # → Build test processes

Docker Compose YML configuration guide more info

Quick Start

Launch the Apache instance locally and setup a local MySQL database container for persistant database data, the goal is to create a easy to use development environment.

The Apache container the directory /data is shared to your local system via Line 7 within docker-container.local.yml file

Type make for more build options:

$ git clone https://github.com/htmlgraphic/Apache.git ~/Docker/Apache && cd ~/Docker/Apache
$ cp .env.example .env
$ make run 
	OR (non Make Windows)

$ copy .env.example .env
$ docker-compose -f docker-compose.local.yml up -d

Run phpMyAdmin

Review MySQL access instructions upon make run command execution. Setup phpMyAdmin directly via command line.

$ docker run --name myadmin -d --link apache_db:db --net apache_default -p 8080:80 phpmyadmin/phpmyadmin

LOCAL: https://localhost:8080

Login using the following creditial stored within the .env file:

username password
root $new_passwordac
$MYSQL_PASSWORD $MYSQL_PASSWORD

Test Driven Development

These continuous integration services will fully test the creation of your container and can push the complete image to your private Docker repo if you desire.

CircleCI 2.0 - Test production and dev Docker builds, can the container be built the without error? Verify each build process using docker-compose. Code can be tested using lxc-attach / docker inspect inside the running container


Shippable - Test production and dev Docker builds, can the container be built the without error? The /tests/build_tests.sh file ensures the can run with parameters defined. Shippable allows the use of matrix environment variables reducing build time and offer a more robust tests. If any test(s) fail the system should be reviewed closer.

Interacting with containers:

List all running containers:

docker ps

List all containers (including stopped containers):

docker ps -a

Read the log of a running container:

docker logs [CONTAINER ID OR NAME]

Follow the log of a running container:

docker logs -f [CONTAINER ID OR NAME]

Read the Apache log:

docker exec [CONTAINER ID OR NAME] cat ./data/apache2/logs/access_log

Follow the Apache log:

docker exec [CONTAINER ID OR NAME] tail -f ./data/apache2/logs/access_log

Follow the outgoing mail log:

docker exec [CONTAINER ID OR NAME] tail -f ./var/log/mail.log

Gain terminal access to a running container:

docker exec -it [CONTAINER ID OR NAME] /bin/bash

Restart a running container:

docker restart [CONTAINER ID OR NAME]

Stop and start a container in separate operations:

docker stop [CONTAINER ID OR NAME]

docker start [CONTAINER ID OR NAME]

Teardown

(Stop all running containers started by Docker Compose):

		$ make rm 
		OR (non Make Windows)
		$ docker rm -f apache_web && docker rm -f apache_db

apache's People

Contributors

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