add Dockerfile
This commit is contained in:
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
__pycache__
|
||||
.venv
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
__pycache__
|
||||
.venv
|
||||
|
||||
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@@ -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" ]
|
||||
19
Makefile
Normal file
19
Makefile
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user