Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
Remove unnecessary dependencies
  • Loading branch information
aneisch authored Jul 23, 2024
1 parent 6abb6b1 commit d4877e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM python:3.8-alpine as base

FROM base as builder
RUN pip install --no-cache-dir --prefix=/install paho-mqtt

RUN apk add --no-cache --update py3-pip && \
pip install --no-cache-dir --prefix=/install paho-mqtt
FROM python:3.8-alpine

FROM base
COPY --from=base /install /usr/local

LABEL org.opencontainers.image.source https://github.com/aneisch/thermostat_api_server_docker

Expand All @@ -14,8 +13,6 @@ HEALTHCHECK --interval=60s --timeout=5s \

EXPOSE 8080

COPY --from=builder /install /usr/local

ENV API_SERVER_ADDRESS 10.0.1.22
ENV MQTT_SERVER 127.0.0.1
ENV MQTT_PORT 1883
Expand All @@ -27,7 +24,10 @@ COPY ./thermostat_api_server.py /usr/bin/thermostat_api_server.py

RUN apk add --no-cache --update curl && \
chmod +x /usr/bin/thermostat_api_server.py && \
pip cache purge && \
pip uninstall -y wheel setuptools pip && \
adduser -D thermostat_api && \
apk list -I && \
apk --purge del apk-tools

USER thermostat_api
Expand Down

0 comments on commit d4877e3

Please sign in to comment.