36 lines
1.1 KiB
Docker
36 lines
1.1 KiB
Docker
FROM python:3.11-slim-bullseye
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
libjpeg-dev zlib1g-dev \
|
|
curl \
|
|
libdbus-1-3 \
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
ARG WIFICONNECT_VERSION=4.11.84
|
|
RUN set -eux; \
|
|
ARCH=$(dpkg --print-architecture); \
|
|
if [ "$ARCH" = "amd64" ]; then \
|
|
WIFI_CONNECT_FILE="wifi-connect-x86_64-unknown-linux-gnu.tar.gz"; \
|
|
elif [ "$ARCH" = "armhf" ] || [ "$ARCH" = "armel" ]; then \
|
|
WIFI_CONNECT_FILE="wifi-connect-armv7-unknown-linux-gnueabihf.tar.gz"; \
|
|
else \
|
|
echo "Unsupported architecture: $ARCH"; exit 1; \
|
|
fi; \
|
|
curl -L -o /tmp/wifi-connect.tar.gz "https://github.com/balena-io/wifi-connect/releases/download/v${WIFICONNECT_VERSION}/${WIFI_CONNECT_FILE}"; \
|
|
tar -xzf /tmp/wifi-connect.tar.gz -C /usr/local/sbin; \
|
|
rm /tmp/wifi-connect.tar.gz
|
|
|
|
WORKDIR /app
|
|
|
|
RUN pip install poetry poetry-plugin-export
|
|
|
|
COPY src/pyproject.toml src/poetry.lock* ./
|
|
|
|
RUN poetry lock && poetry install --no-root
|
|
|
|
COPY src/ .
|
|
COPY entry.sh /usr/bin/entry.sh
|
|
RUN chmod +x /usr/bin/entry.sh
|
|
|
|
CMD ["/usr/bin/entry.sh"] |