diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9f7550b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +__pycache__ +.venv diff --git a/.gitignore b/.gitignore index bee8a64..9f7550b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ __pycache__ +.venv diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7bb5518 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.12-slim +COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv + +COPY uv.lock pyproject.toml ./ +RUN uv sync --frozen + +COPY ./simulation simulation + +ENTRYPOINT [ "uv", "run", "python", "-m", "simulation.app" ] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6c798aa --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +GIT_COMMIT_HASH := $(shell git rev-parse --short HEAD) +DOCKER_REGISTRY = registry.crapts.org + +all: run + +run: + uv run python -m simulation.app + +docker/build: + docker build -t simulation:latest . + +docker/run: docker/build + docker run -it --rm simulation + +docker/push: docker/build + docker tag simulation:latest $(DOCKER_REGISTRY)/simulation:latest + docker tag simulation:latest $(DOCKER_REGISTRY)/simulation:$(GIT_COMMIT_HASH) + docker push $(DOCKER_REGISTRY)/simulation:latest + docker push $(DOCKER_REGISTRY)/simulation:$(GIT_COMMIT_HASH)