diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6c124e1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +tests +.remove +.vscode +assets + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a983e71 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# syntax=docker/dockerfile:1.3 +FROM ubuntu:latest +EXPOSE 8501 +WORKDIR /app +RUN mkdir /usr/src/app +COPY requirements.txt /usr/src/app/ +RUN apt-get update && \ + apt-get install software-properties-common -y && \ + apt-add-repository ppa:ubuntugis/ubuntugis-unstable && \ + apt-get update && \ + apt-get install git curl python3 python3-pip gdal-bin libgdal-dev -y && \ + python3 -m pip install --upgrade pip && \ + python3 -m pip install GDAL==3.4.1 && \ + python3 -m pip install -r /usr/src/app/requirements.txt +COPY . /usr/src/app +RUN python3 -m pip install -e /usr/src/app +WORKDIR /usr/src/app +ENV PYTHONPATH "/usr/src/app:${PYTHONPATH}" +CMD ["dlsc", "--gui"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..43b0b80 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +NAME := cwerner/ldndctools +TAG := $$(git log -1 --pretty=%h) +IMG := ${NAME}:${TAG} +LATEST := ${NAME}:latest + +export DOCKER_BUILDKIT := 1 +export $(xargs < .env) + +build: + @echo ${TAG} + @docker build -t ${IMG} . + @docker tag ${IMG} ${LATEST} + +push: + @docker push ${NAME} + +run: + @docker run --rm -p 8501:8501 --env-file .env ${LATEST} + +login: + @docker log -u ${DOCKER_USER} -p ${DOCKER_PASS}