Skip to content
This repository has been archived by the owner on Dec 17, 2019. It is now read-only.
/ mantle Public archive

Dockerfile for development environment with LEMP Stack

Notifications You must be signed in to change notification settings

hivelocityinc/mantle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mantle

Travis Docker Pulls

The Dockerfile for development environment with LEMP Stack.

Requirements

Includes

It is based on Alpine Linux and includes middleware of the following:

  • Supervisor : 3.2.0
  • Nginx : 1.10
  • PHP : 7.0
  • MySQL(MariaDB) : 10.1
  • Memcached : 1.4
  • Redis : 3.2

Basic Usage

$ docker pull hivelocityinc/mantle
$ docker run -d \
  --name mantle \
  -p 80:80 \
  -v $PWD/{your_app_dir}:/var/www/html/{app_name}
  hivelocityinc/mantle

If you want to use the PHP5, please pull image with hivelocityinc/mantle:php5.

Configuration

You can change the config of middleware when you set environment value of the following:

ENV Key Default Value Description
NGINX_WORKER_PROCESSES 1 Ningx: worker processes
NGINX_SERVER_NAME localhost Ningx: server name
NGINX_DOCUMENT_ROOT /usr/share/nginx/html Nginx: document root path
MYSQL_ROOT_PASSWORD root MySQL: root user's password
MYSQL_DATABASE mantle MySQL: database name
MYSQL_USER mantle MySQL: database user
MYSQL_PASSWORD mantle MySQL: database password for $MYSQL_USER
MEMCACHED_MEMUSAGE 64 Memcached: memory usage size
MEMCACHED_MAXCONN 1024 Memcached: maximum number of concurrent connections

Import DB data

If you want to import databases data to container, to add /initdb.d/schema or /initdb.d/sheeds volume.

# Example
$ docker run -d \
  -v $PWD/{your_schema_dir}:/initdb.d/schema \
  -v $PWD/{your_seed_dir}:/initdb.d/sheeds \
  hivelocityinc/mantle

After script

If you want to run shell script to container, to add /after_run volume.

# Example
$ docker run -d \
  -v $PWD/script/after_run.sh:/after_run/after_run.sh \
  hivelocityinc/mantle

Develop

Firstly, you have to install a gem package for Serverspec.

$ bundle install --path vendor/bundle

Build image from Dockerfile

$ sh ./script/docker.sh build

Run container

$ sh ./script/docker.sh run

Clean up to image and container

$ sh ./script/docker.sh clean

Testing

$ sh ./script/docker.sh test