Skip to content

Commit

Permalink
Add dockerfile and makefile to build/ push/ run it
Browse files Browse the repository at this point in the history
Former-commit-id: ccd836a
  • Loading branch information
cwerner committed Feb 9, 2022
1 parent ac93389 commit 3a38362
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tests
.remove
.vscode
assets

19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit 3a38362

Please sign in to comment.