From fdceedd5b753b580e29771a3a5f46538ffd41393 Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Wed, 21 Mar 2018 16:44:04 -0600 Subject: initial commit --- {{cookiecutter.project_name}}/.gitignore | 9 +++++++++ {{cookiecutter.project_name}}/Makefile | 22 ++++++++++++++++++++++ {{cookiecutter.project_name}}/docker/Dockerfile | 24 ++++++++++++++++++++++++ {{cookiecutter.project_name}}/docker/entry.sh | 3 +++ 4 files changed, 58 insertions(+) create mode 100644 {{cookiecutter.project_name}}/.gitignore create mode 100644 {{cookiecutter.project_name}}/Makefile create mode 100644 {{cookiecutter.project_name}}/docker/Dockerfile create mode 100644 {{cookiecutter.project_name}}/docker/entry.sh (limited to '{{cookiecutter.project_name}}') diff --git a/{{cookiecutter.project_name}}/.gitignore b/{{cookiecutter.project_name}}/.gitignore new file mode 100644 index 0000000..907670f --- /dev/null +++ b/{{cookiecutter.project_name}}/.gitignore @@ -0,0 +1,9 @@ +.*.swp +*.pyc +*.pyo +.DS_Store +tags +.ropeproject +*.actual +.vimcache +.idea \ No newline at end of file diff --git a/{{cookiecutter.project_name}}/Makefile b/{{cookiecutter.project_name}}/Makefile new file mode 100644 index 0000000..921561c --- /dev/null +++ b/{{cookiecutter.project_name}}/Makefile @@ -0,0 +1,22 @@ +.PHONY: build + +CONTAINERNAME={{cookiecutter.docker_namespace}}_{{cookiecutter.project_name}} +IMAGENAME={{cookiecutter.docker_namespace}}/{{cookiecutter.project_name}} + +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +build: ## Build the Docker image + docker build -t $(IMAGENAME) ./docker + +up: build ## Bring the container up + docker run -dP -v $(CURDIR):/app --name $(CONTAINERNAME) $(IMAGENAME) /bin/bash -c '/opt/entry.sh' + +down: ## Stop the container + docker stop $(CONTAINERNAME) || echo 'No container to stop' + +enter: ## Enter the running container + docker exec -it $(CONTAINERNAME) /bin/bash + +clean: down ## Remove the image and any stopped containers + docker rm $(CONTAINERNAME) || echo 'No container to remove' diff --git a/{{cookiecutter.project_name}}/docker/Dockerfile b/{{cookiecutter.project_name}}/docker/Dockerfile new file mode 100644 index 0000000..ebbbe32 --- /dev/null +++ b/{{cookiecutter.project_name}}/docker/Dockerfile @@ -0,0 +1,24 @@ +FROM ubuntu:16.04 + +# Set a term for terminal inside the container, can't clear without it +ENV TERM screen-256color +ENV DEBIAN_FRONTEND noninteractive + + +# Update and install +RUN apt-get update && apt-get install -y \ + wget \ + locales + +# Generally a good idea to have these, extensions sometimes need them +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +# The code should be symlinked to this directory +WORKDIR /app + +# Create the entry script +ADD entry.sh /opt/ +RUN chmod 755 /opt/entry.sh diff --git a/{{cookiecutter.project_name}}/docker/entry.sh b/{{cookiecutter.project_name}}/docker/entry.sh new file mode 100644 index 0000000..09a943f --- /dev/null +++ b/{{cookiecutter.project_name}}/docker/entry.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +while true; do echo hi; sleep 1; done; -- cgit v1.2.3