# Utiliser la base Ubuntu Home Assistant ARG BUILD_FROM=ghcr.io/hassio-addons/ubuntu-base:9.0.1 FROM ${BUILD_FROM} # Installer LocalAI RUN apt-get update && \ apt-get install -y --no-install-recommends \ wget \ ca-certificates && \ wget -O /tmp/localai.tar.gz \ "https://github.com/mudler/LocalAI/releases/download/v2.22.1/local-ai-Linux-x86_64.tar.gz" && \ tar -xzf /tmp/localai.tar.gz -C /usr/local/bin/ && \ chmod +x /usr/local/bin/local-ai && \ rm /tmp/localai.tar.gz && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Variables d'environnement pour LocalAI ENV LOCALAI_P2P="true" ENV LOCALAI_FEDERATED="true" ENV LOCALAI_P2P_LISTEN_PORT="9090" ENV LOCALAI_ADDRESS="0.0.0.0:8080" ENV LOCALAI_CORS="true" ENV LOCALAI_CORS_ALLOW_ORIGINS="*" # Créer le service s6 pour LocalAI RUN mkdir -p /etc/services.d/localai COPY run.sh /etc/services.d/localai/run RUN chmod +x /etc/services.d/localai/run # Build arguments ARG BUILD_DATE ARG BUILD_REF ARG BUILD_VERSION # Labels LABEL \ io.hass.name="LocalAI P2P Worker" \ io.hass.description="LocalAI P2P federation worker node" \ io.hass.arch="${BUILD_ARCH}" \ io.hass.type="addon" \ io.hass.version=${BUILD_VERSION} \ maintainer="Alex " \ org.opencontainers.image.title="LocalAI P2P Worker" \ org.opencontainers.image.description="LocalAI P2P federation worker node" \ org.opencontainers.image.vendor="LocalAI Community" \ org.opencontainers.image.authors="Alex " \ org.opencontainers.image.licenses="MIT" \ org.opencontainers.image.created=${BUILD_DATE} \ org.opencontainers.image.revision=${BUILD_REF} \ org.opencontainers.image.version=${BUILD_VERSION}