fix: no stdout visible inside docker -> use unbuffered mode; use alpine version of python base image

This commit is contained in:
Daniel Langbein 2020-11-25 19:59:43 +01:00
parent 8c30c35128
commit e334665066
3 changed files with 9 additions and 8 deletions

View File

@ -1,10 +1,12 @@
FROM python:3.8
FROM python:3.8-alpine
WORKDIR /usr/src/
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt
COPY ./src/ ./
RUN chmod +x ./logMeetingData.py
CMD [ "python", "./logMeetingData.py" ]
# unbuffered output option otherwise script sleeps before any output appears
CMD [ "python", "-u", "./logMeetingData.py" ]

View File

@ -2,9 +2,8 @@ version: '3.7'
services:
dk-gen:
build: .
environment:
- PYTHONPATH=/usr/src/
# environment:
# - PYTHONPATH=/usr/src/
volumes:
# - ./src/:/usr/src/
- ./secret:/usr/secret
- ./data:/usr/data

View File

@ -13,7 +13,7 @@ def sleepFiveMin(verbose=False):
fiveMinutes = 5 * minute
if verbose:
print("> Sleeping for five minutes ...")
print(">> Sleeping for five minutes <<")
time.sleep(fiveMinutes)