From c21d5cbc19bd4cf70fceaebd2755674c8f0746a8 Mon Sep 17 00:00:00 2001 From: Alexandr Meshchriakov Date: Wed, 19 Mar 2025 23:55:05 +0100 Subject: [PATCH] update repository references and improve script handling --- Makefile | 1 + base_docker_images/python/3.11/Dockerfile | 14 +++++++++ blank-fastapi-vue-hassio/Dockerfile | 35 ++++++++--------------- blank-fastapi-vue-hassio/config.json | 2 +- 4 files changed, 28 insertions(+), 24 deletions(-) create mode 100644 base_docker_images/python/3.11/Dockerfile diff --git a/Makefile b/Makefile index a1121bb..c2fc3c1 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,7 @@ build: push: @echo "Отправляем образы в Docker Hub..." + @docker login @for dockerfile in $(BASE_IMAGE_DOCKERFILES); do \ dir=$$(dirname $$dockerfile); \ tag_name=$$(echo $$dir | sed 's|^\./||' | tr '/' '-' | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]'); \ diff --git a/base_docker_images/python/3.11/Dockerfile b/base_docker_images/python/3.11/Dockerfile new file mode 100644 index 0000000..29055c9 --- /dev/null +++ b/base_docker_images/python/3.11/Dockerfile @@ -0,0 +1,14 @@ +FROM python:3.11-slim + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gcc curl && \ + pip install --no-cache-dir uvloop && \ + apt-get remove -y gcc && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN curl -LsSf https://astral.sh/uv/install.sh | sh +RUN echo 'eval "$(uv generate-shell-completion bash)"' >> ~/.bashrc + +CMD ["python"] \ No newline at end of file diff --git a/blank-fastapi-vue-hassio/Dockerfile b/blank-fastapi-vue-hassio/Dockerfile index e8d0223..bfed637 100644 --- a/blank-fastapi-vue-hassio/Dockerfile +++ b/blank-fastapi-vue-hassio/Dockerfile @@ -1,25 +1,14 @@ -FROM python:3.11-buster +FROM mesteriis/hassio-python-3.11:latest -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 requirements.txt /tmp/ +RUN pip install --no-cache-dir -r /tmp/requirements.txt + +COPY ./src /app + +WORKDIR /app + +# Expose the port the app runs on +EXPOSE 8000 +# Run the application +CMD ["uvicorn", "main:app"] -RUN pip install --upgrade pip -RUN pip install --upgrade setuptools -RUN pip install --upgrade wheel -RUN pip install uv \ No newline at end of file diff --git a/blank-fastapi-vue-hassio/config.json b/blank-fastapi-vue-hassio/config.json index 6f96ab4..4fd0f8c 100755 --- a/blank-fastapi-vue-hassio/config.json +++ b/blank-fastapi-vue-hassio/config.json @@ -15,6 +15,6 @@ "options": {}, "schema": {}, "ports": { - "5000/tcp": 5000 + "8000/tcp": 8000 } } \ No newline at end of file