forked from ThomDietrich/miflora-mqtt-daemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
21 lines (18 loc) · 776 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
##Miflora-mqtt-daemon Docker image
#Builds compact image to run as an alternative to installing the modules/service.
# The build image
FROM python:3.10.7-slim as builder
LABEL stage=builder
RUN apt-get update && apt-get install bluez gcc libglib2.0-dev build-essential -y && apt-get clean
COPY requirements.txt /app/requirements.txt
WORKDIR /app/
RUN pip install --user -r requirements.txt
COPY . /app
# The production image
FROM python:3.10.7-slim as app
RUN apt-get update && apt-get install bluetooth bluez -y && apt-get clean
COPY --from=builder /root/.local /root/.local
COPY --from=builder /app/miflora-mqtt-daemon.py /app/miflora-mqtt-daemon.py
WORKDIR /app/
ENV PATH=/root/.local/bin:$PATH
CMD [ "python3", "./miflora-mqtt-daemon.py", "--config_dir", "/config" ]