cleaner Dockerfile

This commit is contained in:
Daniel Langbein 2022-12-12 21:26:44 +01:00
parent 51dbeae02c
commit 3c29e49cdb
2 changed files with 12 additions and 9 deletions

View File

@ -2,7 +2,7 @@
# - https://docs.docker.com/language/python/build-images/
FROM python:3.10-slim-buster
WORKDIR /usr/src/
WORKDIR /app
# Set timezone.
# - https://dev.to/0xbf/set-timezone-in-your-docker-image-d22
@ -11,11 +11,16 @@ WORKDIR /usr/src/
RUN apt update && apt install tzdata -y
ENV TZ="Europe/Berlin"
COPY requirements.txt ./
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
COPY src/ ./
COPY src/ .
RUN chmod +x langfingaz/main.py
# pythonpath is required to import from self created modules ("from langfingaz ...")
ENV PYTHONPATH=/app/
# unbuffered output, otherwise script sleeps before any output appears
ENV PYTHONUNBUFFERED=1
ENTRYPOINT [ "python3", "./langfingaz/main.py" ]
CMD [ "log-verbose" ]

View File

@ -1,13 +1,11 @@
version: '3.7'
services:
bbb-status:
container_name: bbb-status
build: .
command: ["log-verbose"] # see main.py for available commandline arguments
restart: unless-stopped
environment:
- PYTHONPATH=/usr/src/ # pythonpath is required to import from self created modules ("from langfingaz ...")
- PYTHONUNBUFFERED=1 # unbuffered output, otherwise script sleeps before any output appears
volumes:
- ./secret:/usr/secret
- ./data:/usr/data
- ./plot:/usr/plot
- ./secret:/secret
- ./data:/data
- ./plot:/plot