Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Melcher authored and Mario Melcher committed Mar 24, 2022
1 parent ff7c8e7 commit 377be8e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ __pycache__

# ignore temporary folder for downloads
tmp

# ignore data
data/*
!data/.gitkeep
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM python:3-slim

RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
sudo \
ca-certificates \
netbase \
pdftohtml \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*

ENV USER_NAME="user" \
USER_UID="1000" \
USER_GID="1000"

RUN groupadd --gid $USER_GID $USER_NAME \
&& useradd --gid $USER_GID --uid $USER_UID --create-home $USER_NAME

USER user

COPY . /home/user

ENV PATH="${PATH}:/home/user/.local/bin"
RUN cd /home/user \
&& python -m pip install --upgrade pip \
&& pip install -r tools/requirements.txt


VOLUME ["/home/user/data"]
ENTRYPOINT ["python3"]
CMD ["/home/user/tools/download_and_convert.py"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ Vor dem Ausführen müssen die Python-Abhängigkeiten installiert werden:
Die Daten werden im "data" Ordner abgelegt.

## Howto Docker Alternative

Wenn man unabhängig vom Betriebssystem sein will, kann so vorgegangen werden:

> docker build -t grundschmutz-tools:latest .
> docker run --rm -v $(pwd)/data:/home/user/data grundschmutz-tools
Der Teil ```$(pwd)/data``` muss ggf. je nach Betriebssystem angepasst werden (siehe [docs.docker.com VOLUME](https://docs.docker.com/engine/reference/run/#volume-shared-filesystems)).

## Intention

Nach dem Prinzip von [Open Data](https://de.wikipedia.org/wiki/Open_Data) sollten alle öffentlichen Daten möglichst [maschinenlesbar](https://en.wikipedia.org/wiki/Machine-readable_data) zur Verfügung gestellt werden, damit man sie filtern, verknüpfen oder anderweitig verarbeiten kann.
Expand Down
Empty file added data/.gitkeep
Empty file.

0 comments on commit 377be8e

Please sign in to comment.