diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..54970eec --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM mambaorg/micromamba:latest + +USER root + +WORKDIR /lidro + +# # Set up the Conda environment: cf https://github.com/mamba-org/micromamba-docker +COPY environment.yml /tmp/env.yaml +COPY requirements.txt /tmp/requirements.txt +RUN chown $MAMBA_USER:$MAMBA_USER /tmp/env.yaml +RUN micromamba install -y -n base -f /tmp/env.yaml && \ + micromamba clean --all --yes + +ENV ENV=base +ARG MAMBA_DOCKERFILE_ACTIVATE=1 + + +COPY lidro lidro +COPY configs configs \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..49748893 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +# Makefile to manage main tasks +# cf. https://blog.ianpreston.ca/conda/python/bash/2020/05/13/conda_envs.html#makefile + +# Oneshell means I can run multiple lines in a recipe in the same shell, so I don't have to +# chain commands together with semicolon +.ONESHELL: +SHELL = /bin/bash +install: + pip install -e . + +install-precommit: + pre-commit install + +mamba-env-create: + mamba env create -n lidro -f environment.yml + +mamba-env-update: + mamba env update -n lidro -f environment.yml + +############################## +# Docker +############################## + +PROJECT_NAME=lidar_hd/lidro +VERSION=`python -m lidro._version` + +docker-build: + docker build -t ${PROJECT_NAME}:${VERSION} -f Dockerfile . + +docker-remove: + docker rmi -f `docker images | grep ${PROJECT_NAME} | tr -s ' ' | cut -d ' ' -f 3` + docker rmi -f `docker images -f "dangling=true" -q`