Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile and requirements.txt to repo. #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .devcontainer/python.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3

WORKDIR /opt/timer

COPY requirements.txt /opt/timer/requirements.txt
COPY termdown.py /opt/timer/termdown.py

RUN python3 -m pip install --no-cache-dir -r requirements.txt


ENTRYPOINT [ "python", "/opt/timer/termdown.py" ]
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.PHONY: help build-image

CONTAINER_DIR ?= .devcontainer
WORK_DIR ?= $(shell pwd)
USERNAME ?= testuser
USER_UID ?= 1000
USER_GID ?= 1000

IMAGE_NAME ?= termdown
CONTAINER_NAME ?= $(IMAGE_NAME)-$(USERNAME)-$(shell date +"%Y-%m-%d.%H-%M")
DOCKER_FILE ?= $(CONTAINER_DIR)/python.Dockerfile
DOCKER_ENTRYPOINT ?=
SHARED_DIRS ?=


define BUILD_IMAGE_HELP_INFO
build-image
Build the docker image
endef
export BUILD_IMAGE_HELP_INFO

build-image:
@docker build -t $(IMAGE_NAME) \
--build-arg DOCKER_ENTRYPOINT=$(DOCKER_ENTRYPOINT) \
--file $(DOCKER_FILE) .

# ============================================================================= #

define RUN_CONTAINER_HELP_INFO
run-container
Run container from the docker image
endef
export RUN_CONTAINER_HELP_INFO

run-container:
@docker run -it $(IMAGE_NAME)

# ============================================================================= #

help:
@echo "Usage: make [TARGET] [VARIABLE=value]\n"
@echo "$$BUILD_IMAGE_HELP_INFO\n"
@echo "$$RUN_CONTAINER_HELP_INFO\n"
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Click
python-dateutil
pyfiglet