aboutsummaryrefslogtreecommitdiff

Cookiecutter Docker

What is this repo?

This repo is a coookiecutter recipe for spinning up dockerized projects. I use this recipe on every project that I spin up for encapsulating everything into a docker container that I can share with other devs easily.

How do I use it?

First install CookieCutter and then use cookie cutter to spin up a new project from this repo.

cookiecutter https://git.codyhiar.com/docker/cookiecutter-docker

You will be asked for a project name as well a a docker user. The project name can be what ever you want and the docker user will be the prefix you use for your images on dockerhub. E.g. My docker images are usually thornycrackers/proj so I would use thornycrackers. After that you will have a new project setup that includes a preset docker-compose.yml with a simple Dockerfile and a Makefile that will automate controlling the container. The following commands work out of the box.

make build       # Build your `docker_user/proj_name` image
make up          # Spin up your container and forwards port 8000 by default and mounts local file
make enter       # Open a bash terminal in the container
make down        # Stop the container
make clean       # Remove the stopped container