2024-09-05 16:09:06 +12:00
|
|
|
FROM ghcr.io/esphome/docker-base:2024.9.0 AS base
|
2021-09-20 09:07:38 +02:00
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
RUN git config --system --add safe.directory "*"
|
2023-11-09 02:04:39 -06:00
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
COPY requirements.txt /
|
2021-09-20 09:07:38 +02:00
|
|
|
|
2022-12-15 21:27:59 +01:00
|
|
|
RUN \
|
2024-09-02 18:38:51 +12:00
|
|
|
uv pip install --no-cache-dir \
|
|
|
|
-r /requirements.txt
|
2022-12-15 21:27:59 +01:00
|
|
|
|
2021-09-20 09:07:38 +02:00
|
|
|
RUN \
|
|
|
|
# Change some platformio settings
|
2024-09-02 18:38:51 +12:00
|
|
|
platformio settings set enable_telemetry No \
|
2021-09-20 09:07:38 +02:00
|
|
|
&& platformio settings set check_platformio_interval 1000000 \
|
|
|
|
&& mkdir -p /piolibs
|
2019-02-13 16:54:02 +01:00
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
COPY script/platformio_install_deps.py platformio.ini /
|
2021-09-20 10:31:48 +02:00
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
RUN /platformio_install_deps.py /platformio.ini --libraries
|
2023-10-17 20:33:19 -10:00
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
FROM base AS base-docker
|
2020-07-15 15:03:15 +02:00
|
|
|
|
|
|
|
ENV USERNAME="" PASSWORD=""
|
2020-12-30 10:58:09 +01:00
|
|
|
EXPOSE 6052
|
|
|
|
|
2023-11-02 19:19:43 +01:00
|
|
|
HEALTHCHECK --interval=30s --timeout=30s \
|
2024-09-02 18:38:51 +12:00
|
|
|
CMD curl --fail http://localhost:6052/version -A "HealthCheck" || exit 1
|
2023-11-02 19:19:43 +01:00
|
|
|
|
2021-09-20 09:07:38 +02:00
|
|
|
COPY docker/docker_entrypoint.sh /entrypoint.sh
|
2021-01-27 07:16:59 +01:00
|
|
|
|
2021-09-20 09:07:38 +02:00
|
|
|
VOLUME /config
|
2019-02-13 16:54:02 +01:00
|
|
|
WORKDIR /config
|
2021-09-20 09:07:38 +02:00
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
2021-06-08 01:14:12 +02:00
|
|
|
CMD ["dashboard", "/config"]
|
2021-09-20 09:07:38 +02:00
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
FROM base AS base-hassio
|
2021-09-20 09:07:38 +02:00
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
# TODO: Install s6-overlay
|
2021-09-20 09:07:38 +02:00
|
|
|
|
|
|
|
RUN \
|
2024-09-02 18:38:51 +12:00
|
|
|
set -x \
|
|
|
|
&& apt-get update \
|
2021-09-20 09:07:38 +02:00
|
|
|
&& apt-get install -y --no-install-recommends \
|
2023-10-17 20:33:19 -10:00
|
|
|
nginx-light=1.22.1-9 \
|
2021-09-20 09:07:38 +02:00
|
|
|
&& rm -rf \
|
|
|
|
/tmp/* \
|
|
|
|
/var/{cache,log}/* \
|
2024-09-02 18:38:51 +12:00
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
/usr/src/*
|
2021-09-20 09:07:38 +02:00
|
|
|
|
|
|
|
ARG BUILD_VERSION=dev
|
|
|
|
|
2022-02-09 23:46:20 +13:00
|
|
|
COPY docker/ha-addon-rootfs/ /
|
2021-09-20 09:07:38 +02:00
|
|
|
|
|
|
|
LABEL \
|
|
|
|
io.hass.name="ESPHome" \
|
2024-09-02 18:38:51 +12:00
|
|
|
io.hass.description="Manage and program microcontrollers through YAML configuration files" \
|
2021-09-20 09:07:38 +02:00
|
|
|
io.hass.type="addon" \
|
|
|
|
io.hass.version="${BUILD_VERSION}"
|
|
|
|
|
|
|
|
|
2024-09-10 08:49:41 +12:00
|
|
|
ARG BUILD_TYPE=docker
|
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
FROM base-${BUILD_TYPE} AS final
|
2021-09-20 09:07:38 +02:00
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
COPY . /esphome
|
2021-09-20 09:07:38 +02:00
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
RUN uv pip install --no-cache-dir -e /esphome
|
2021-09-20 09:07:38 +02:00
|
|
|
|
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
FROM base AS lint
|
2021-09-20 10:31:48 +02:00
|
|
|
|
2024-09-02 18:38:51 +12:00
|
|
|
# TODO:
|