diff options
author | Cody Hiar <codyfh@gmail.com> | 2018-03-21 16:44:04 -0600 |
---|---|---|
committer | Cody Hiar <codyfh@gmail.com> | 2018-03-21 16:44:04 -0600 |
commit | fdceedd5b753b580e29771a3a5f46538ffd41393 (patch) | |
tree | 4999ea4146fc559ddcde4a2c9416cbb70bbcffc7 /{{cookiecutter.project_name}} |
initial commit
Diffstat (limited to '{{cookiecutter.project_name}}')
-rw-r--r-- | {{cookiecutter.project_name}}/.gitignore | 9 | ||||
-rw-r--r-- | {{cookiecutter.project_name}}/Makefile | 22 | ||||
-rw-r--r-- | {{cookiecutter.project_name}}/docker/Dockerfile | 24 | ||||
-rw-r--r-- | {{cookiecutter.project_name}}/docker/entry.sh | 3 |
4 files changed, 58 insertions, 0 deletions
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; |