Skip to content

Docker containers for services to support local development

Notifications You must be signed in to change notification settings

meshu-dev/docker-services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker setup for services

This setup allows you to use docker and docker-compose to provide services to support development.

Prerequisites

Install Gitbash if using Windows

Go to user directory and open the .bashrc file

vim ~/.bashrc

Add the following shorthand for the docker-compose command...

# Docker
alias dc='docker-compose'

Setup

  1. Open up terminal application and change to a directory where you want your docker dev setup, an example would be...
cd ~/
  1. Clone repository and then change directory to inside of the repository
git clone git@github.com:meshu-dev/docker-services.git
cd docker-services
  1. Create docker network by running the following command...
docker network create dev
  1. Update hosts file with docker container domains...
vim /etc/hosts
127.0.0.1   mysql.local
127.0.0.1   mongodb.local
127.0.0.1   mongoexpress.local
127.0.0.1   postgresql.local
127.0.0.1   redis.local

Windows version

If you are using Windows OS do the following...

Press the Start menu, search for "notepad" and select the "Run as administrator".

Once notepad has opened select File -> Open, add in the following directory and then press enter to show the hosts file.

C:\Windows\system32\drivers\etc\

Select hosts to open, add in the below lines, save and finally close notepad.

127.0.0.1   mysql.local
127.0.0.1   mongodb.local
127.0.0.1   mongoexpress.local
127.0.0.1   postgresql.local
127.0.0.1   redis.local
  1. Create and run containers with the following command...
dc up -d
  1. Up open your web browser and go to http://adminer.local and the website should show up.

  2. Start expanding the docker dev setup by adding your own services, check below to see commands on how to use setup.


Docker compose commands

A full list of docker-compose commands can be found at https://docs.docker.com.

Here is a list of common docker-compose commands you would use...

Docker Compose - Up

Usage:

dc up -d

Start up service docker containers.


Docker Compose - Down

Usage:

dc down

Shutdown service docker containers.


Docker Compose - Build

Usage:

dc build

Build service docker containers.

About

Docker containers for services to support local development

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published