-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (24 loc) · 921 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM python:3.9-bullseye AS prod
LABEL maintainer="Joshua Thorpe"
# Try install rpi.io via apt (arm) or pip (x86)
RUN apt-get update \
&& apt-get install -yq rpi.gpio || pip install --no-cache-dir RPi.GPIO \
; apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /root/smart-gate
COPY . .
# Install dependencies
RUN pip install --no-cache-dir --upgrade pip \
&& export READTHEDOCS=True \
&& pip install --no-cache-dir -e . \
&& rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info
RUN bash arduino_src/install_and_configure_arduino-cli.sh
# Allow arduino upload script to be used as alternative entrypoint
RUN chmod o+x arduino_src/upload.sh
ARG VERSION
LABEL version="$VERSION"
ENV SMART_GATE_VERSION="$VERSION"
ENV SMART_GATE_CONTAINER="TRUE"
CMD ["python3", "rpi_src/main.py"]
FROM prod AS dev
RUN pip install --no-cache-dir -e .[dev] \
&& rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info