esphome-docs/Dockerfile

48 lines
1.5 KiB
Docker
Raw Normal View History

2024-04-23 04:32:37 +02:00
FROM python:3.12-slim
2018-06-09 09:58:58 +02:00
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
make \
doxygen \
2018-08-27 13:21:30 +02:00
openssh-client \
software-properties-common \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
ENV PAGEFIND_VERSION="1.1.0"
ARG TARGETARCH
SHELL ["/bin/bash", "-c"]
RUN <<EOF
export TARGETARCH=${TARGETARCH/arm64/aarch64}
export TARGETARCH=${TARGETARCH/amd64/x86_64}
curl -o pagefind.tar.gz https://github.com/CloudCannon/pagefind/releases/download/v$PAGEFIND_VERSION/pagefind-v$PAGEFIND_VERSION-$TARGETARCH-unknown-linux-musl.tar.gz -L
tar xzf pagefind.tar.gz
rm pagefind.tar.gz
mv pagefind /usr/bin
chmod +x /usr/bin/pagefind
EOF
2024-04-23 04:32:37 +02:00
RUN useradd -ms /bin/bash esphome
2024-04-23 04:32:37 +02:00
USER esphome
WORKDIR /workspaces/esphome-docs
2024-04-25 13:23:40 +02:00
ENV PATH="${PATH}:/home/esphome/.local/bin"
2024-04-23 04:32:37 +02:00
COPY requirements.txt ./
2021-07-14 02:57:00 +02:00
RUN pip3 install --no-cache-dir --no-binary :all: -r requirements.txt
2018-06-09 09:58:58 +02:00
EXPOSE 8000
CMD ["make", "live-html"]
2024-04-23 04:32:37 +02:00
LABEL \
org.opencontainers.image.title="esphome-docs" \
org.opencontainers.image.description="An image to help with ESPHomes documentation development" \
org.opencontainers.image.vendor="ESPHome" \
org.opencontainers.image.licenses="CC BY-NC-SA 4.0" \
org.opencontainers.image.url="https://esphome.io" \
org.opencontainers.image.source="https://github.com/esphome/esphome-docs" \
org.opencontainers.image.documentation="https://github.com/esphome/esphome-docs/blob/current/README.md"