update repository references and improve script handling

This commit is contained in:
2025-03-19 23:45:56 +01:00
parent 3392e9d80f
commit ecce3bf159
11 changed files with 150 additions and 181 deletions

70
blank-fastapi-vue-hassio/Dockerfile Executable file → Normal file
View File

@@ -1,49 +1,25 @@
ARG BUILD_FROM=hassioaddons/base-python:5.2.0
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
FROM python:3.11-buster
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
libssl-dev \
libffi-dev \
python3-dev \
libpq-dev \
libjpeg-dev \
libwebp-dev \
libtiff5-dev \
zlib1g-dev \
libxml2-dev \
libxslt1-dev \
libldap2-dev \
libsasl2-dev \
libmysqlclient-dev \
default-libmysqlclient-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy Python requirements file
COPY hello_flask/requirements.txt /tmp/
COPY hello_flask/app.py /
# Setup base
ARG BUILD_ARCH=amd64
RUN \
apk add --no-cache --virtual .build-dependencies \
g++=9.2.0-r4 \
gcc=9.2.0-r4 \
make=4.2.1-r2 \
\
&& apk add --no-cache \
nginx-mod-http-lua=1.16.1-r6 \
lua-resty-http=0.15-r0 \
nginx=1.16.1-r6 \
cython=0.29.14-r0 \
\
&& pip3 install \
--no-cache-dir \
--prefer-binary \
--find-links "https://wheels.hass.io/alpine-3.11/${BUILD_ARCH}/" \
-r /tmp/requirements.txt \
\
&& find /usr/local \
\( -type d -a -name test -o -name tests -o -name '__pycache__' \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
\
&& apk del --purge .build-dependencies \
&& rm -f -r \
/etc/nginx \
/tmp/*
# Copy data for add-on
COPY run.sh /
COPY hello_flask/requirements.txt /tmp/
# Install requirements for add-on
RUN pip install -r /tmp/requirements.txt
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
RUN pip install --upgrade wheel
RUN pip install uv