Skip to content

Commit

Permalink
Fixed Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWeirdDev committed Jan 5, 2022
1 parent b277188 commit fa98b03
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM python:3.9 AS build-stage
# Builder
FROM python:3.9-slim-bullseye as builder
RUN apt update && apt install -y build-essential bluetooth libbluetooth-dev
WORKDIR /app
COPY . .
RUN pip3 install pybluez pyinstaller
RUN pyinstaller -w -F \
--noconfirm \
bluetooth_battery.py
RUN pip3 wheel --no-cache-dir --no-deps --wheel-dir /app/wheel/ pybluez

FROM debian:buster-slim AS deploy-stage
COPY --from=build-stage /app/dist/bluetooth_battery /bluetooth_battery
ENTRYPOINT ["/bluetooth_battery"]
### Final
FROM python:3.9-slim-bullseye
RUN apt update && apt install -y libbluetooth3
WORKDIR /app
COPY --from=builder /app/wheel /wheels
RUN pip3 install --no-cache /wheels/*
COPY ./bluetooth_battery.py .
ENTRYPOINT ["python3", "./bluetooth_battery.py"]

0 comments on commit fa98b03

Please sign in to comment.