test
Some checks failed
Builder / Build addons (localai-p2p-master, amd64) (push) Failing after 9s
Builder / Build addons (localai-p2p-worker, amd64) (push) Failing after 8s
Validate / validate (push) Failing after 2s
Builder / Create release (push) Has been skipped

This commit is contained in:
2025-05-30 15:57:59 +02:00
parent 70e1bebf0d
commit 1364c3c492
24 changed files with 349 additions and 80 deletions

View File

@@ -1,16 +1,17 @@
FROM localai/localai:latest-cpu
# Utiliser la base Ubuntu Home Assistant
ARG BUILD_FROM=ghcr.io/hassio-addons/ubuntu-base:9.0.1
FROM ${BUILD_FROM}
# Installer bashio pour Home Assistant
# Installer LocalAI
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl jq && \
curl -J -L -o /tmp/bashio.tar.gz \
"https://github.com/hassio-addons/bashio/archive/v0.16.2.tar.gz" && \
mkdir /tmp/bashio && \
tar zxvf /tmp/bashio.tar.gz --strip 1 -C /tmp/bashio && \
mv /tmp/bashio/lib /usr/lib/bashio && \
ln -s /usr/lib/bashio/bashio /usr/bin/bashio && \
rm -rf /tmp/bashio* && \
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/*
@@ -22,8 +23,29 @@ ENV LOCALAI_ADDRESS="0.0.0.0:8080"
ENV LOCALAI_CORS="true"
ENV LOCALAI_CORS_ALLOW_ORIGINS="*"
# Copier le script de démarrage
COPY run.sh /usr/bin/run.sh
RUN chmod +x /usr/bin/run.sh
# Cer 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
ENTRYPOINT ["/usr/bin/run.sh"]
# 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 <alex@example.com>" \
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 <alex@example.com>" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}