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/ WORKDIR /usr/src/
COPY requirements.txt ./ COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt RUN pip3 install --no-cache-dir -r requirements.txt
COPY ./src/ ./ 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: services:
dk-gen: dk-gen:
build: . build: .
environment: # environment:
- PYTHONPATH=/usr/src/ # - PYTHONPATH=/usr/src/
volumes: volumes:
# - ./src/:/usr/src/
- ./secret:/usr/secret - ./secret:/usr/secret
- ./data:/usr/data - ./data:/usr/data

View File

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