Skip to content

steadystatic/docker-examples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Examples

Docker examples :p, please check all services in docker-compose.yml

Getting Started

  1. Install Docker
  2. Clone project: git clone https://github.com/jojoee/docker-examples.git
  3. Go to repository directory: cd docker-examples
  4. Copy: cp -a source/hello-node/. image/node/
  5. Create volumns folder: mkdir ~/Volumns
  6. Add point domain name into host file
127.0.0.1 site91.doc
127.0.0.1 site92.doc
127.0.0.1 site101.doc
127.0.0.1 site102.doc
127.0.0.1 site111.doc
127.0.0.1 site112.doc

Then run: docker-compose up -d

Source

  1. Install Composer
  2. Install Node.js
source/hello-php
- composer install

source/hello-node
- npm install -g yarn && yarn

Folder structure

docker-examples
  ├── image
  └── source

Update

  • Deploy support
  • Swarm mode
  • Test script
  • Merge similar services into one
  • Load Balance
  • Monitoring

How to test it

- nginx (static)
http://localhost:8001
http://localhost:8001/image/test.png
http://localhost:8002
http://localhost:8002/image/test.png

- apache
- php
http://localhost:8011

- apache
- php
- mysql
http://localhost:8012

- apache (custom vhost)
- php
- mysql
http://localhost:8013
http://site91.doc:8013
http://site92.doc:8013
http://site92.doc:8013
http://localhost:8014
http://site101.doc:8014
http://site102.doc:8014
http://localhost:8015

- apache
- php (wordpress)
- mysql
http://localhost:8021
http://localhost:8022
http://localhost:8023

- node
http://localhost:8031
if want to try more please run
$ docker exec -it ctn_node /bin/bash
$ pm2 start index.js
http://localhost:8032

 - node (no volumes)
http://localhost:8033

- nginx
- php (fpm)
- mysql
http://localhost:8041
http://site111.doc:8041
http://site112.doc:8041

- phpMyAdmin
http://localhost:9001

- adminer
http://localhost:9002

Reference

Tutorial

Example projects

Future reading

About

🎉 A Docker examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 51.7%
  • JavaScript 42.3%
  • Shell 6.0%