-
Notifications
You must be signed in to change notification settings - Fork 0
/
watchdog-dockerfile
32 lines (23 loc) · 994 Bytes
/
watchdog-dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM python:3.8 as base
RUN apt update && apt install -y \
gdal-bin postgresql-client python3-pip && \
rm -rf /var/lib/apt/lists/* && \
pip3 install watchdog
FROM base as build
COPY ./config/watcher/ingest_vector_data.sh /ingest_vector_data.sh
COPY ./config/watcher/vector_file_availability.sh /vector_file_availability.sh
COPY ./config/watcher/watcher.py /watcher.py
# Use polling observer, required for windows
# COPY ./config/watcher/watcher-poll.py /watcher.py
RUN chmod +x /ingest_vector_data.sh
RUN chmod +x /vector_file_availability.sh
ARG TARGET=./data
ENV TARGET $TARGET
ARG STARTUP_DELAY=5
ENV STARTUP_DELAY $STARTUP_DELAY
# Run watchdog script unbuffered to ensure that the stdout and stderr
# are available when running as daemonized process in the container.
# The environment variable does the same thing as the -u switch
# both are included here simply for the sake of redundancy/ resilience.
ENV PYTHONUNBUFFERED=1
ENTRYPOINT ["python3","-u","/watcher.py"]