Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kido
committed
Dec 26, 2017
1 parent
7eb8d81
commit 9934b7a
Showing
16 changed files
with
871 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
# See https://docs.docker.com/compose/environment-variables/#the-env-file | ||
|
||
# Nginx | ||
NGINX_HOST=localhost | ||
|
||
# MySQL | ||
MYSQL_HOST=mysql | ||
MYSQL_DATABASE=test | ||
MYSQL_ROOT_USER=root | ||
MYSQL_ROOT_PASSWORD=root | ||
MYSQL_USER=dev | ||
MYSQL_PASSWORD=dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM ubuntu:latest | ||
MAINTAINER Dan Pupius <dan@pupi.us> | ||
|
||
# Install apache, PHP, and supplimentary programs. openssh-server, curl, and lynx-cur are for debugging the container. | ||
RUN apt-get update && apt-get -y upgrade && DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
apache2 php7.0 php7.0-mysql libapache2-mod-php7.0 curl lynx-cur | ||
|
||
# Enable apache mods. | ||
RUN a2enmod php7.0 | ||
RUN a2enmod rewrite | ||
|
||
# Update the PHP.ini file, enable <? ?> tags and quieten logging. | ||
RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php/7.0/apache2/php.ini | ||
RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.0/apache2/php.ini | ||
|
||
# Manually set up the apache environment variables | ||
ENV APACHE_RUN_USER www-data | ||
ENV APACHE_RUN_GROUP www-data | ||
ENV APACHE_LOG_DIR /var/log/apache2 | ||
ENV APACHE_LOCK_DIR /var/lock/apache2 | ||
ENV APACHE_PID_FILE /var/run/apache2.pid | ||
|
||
# Expose apache. | ||
EXPOSE 80 | ||
|
||
# Copy this repo into place. | ||
ADD web /var/www/site | ||
|
||
# Update the default apache site with the config we created. | ||
ADD etc/apache/sites-enabled/apache-config.conf /etc/apache2/sites-enabled/000-default.conf | ||
|
||
# By default start up apache in the foreground, override with /bin/bash for interative. | ||
CMD /usr/sbin/apache2ctl -D FOREGROUND | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
version: "2" | ||
services: | ||
reverseproxy: | ||
image: nginx | ||
container_name: nginx-docker | ||
volumes: | ||
- "./etc/nginx/conf.d:/etc/nginx/conf.d" | ||
- "./etc/ssl:/etc/ssl" | ||
- "./web:/var/www/html" | ||
- "./etc/nginx/conf.d/default.template:/etc/nginx/conf.d/default.template" | ||
- "./etc/nginx/nginx.conf:/etc/nginx/nginx.conf" | ||
- "./etc/nginx/log/error.log:/var/log/nginx/error.log" | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
environment: | ||
- NGINX_HOST=${NGINX_HOST} | ||
command: /bin/bash -c "envsubst '$$NGINX_HOST' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" | ||
restart: always | ||
depends_on: | ||
- mysqldb | ||
- web | ||
web: | ||
image: apachemy | ||
container_name: apache-docker | ||
volumes: | ||
- "./web:/var/www/site" | ||
- "./etc/apache/httpd.conf:/usr/local/apache2/conf/httpd.conf" | ||
- "./etc/apache/sites-available:/etc/apache2/sites-available" | ||
- "./etc/apache/sites-enabled:/etc/apache2/sites-enabled" | ||
ports: | ||
- "8099:80" | ||
restart: always | ||
depends_on: | ||
- mysqldb | ||
myadmin: | ||
image: phpmyadmin/phpmyadmin | ||
container_name: phpmyadmin | ||
ports: | ||
- "8080:80" | ||
environment: | ||
- PMA_ARBITRARY=1 | ||
- PMA_HOST=${MYSQL_HOST} | ||
restart: always | ||
depends_on: | ||
- mysqldb | ||
mysqldb: | ||
image: mysql | ||
container_name: ${MYSQL_HOST} | ||
restart: always | ||
env_file: | ||
- ".env" | ||
environment: | ||
- MYSQL_DATABASE=${MYSQL_DATABASE} | ||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} | ||
- MYSQL_USER=${MYSQL_USER} | ||
- MYSQL_PASSWORD=${MYSQL_PASSWORD} | ||
ports: | ||
- "8989:3306" | ||
volumes: | ||
- "./data/db/mysql:/var/lib/mysql" |
Oops, something went wrong.