aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 1f2794bb972e8f8754585182ae0da2f1a4f29144 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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][1] and then use cookie cutter to spin up a new
project from this repo.

```bash
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
```


[1]: https://github.com/audreyr/cookiecutter