|
|
FROM node:22 |
|
|
|
|
|
RUN apt update && apt install -y \ |
|
|
gcc \ |
|
|
curl \ |
|
|
wget \ |
|
|
sudo \ |
|
|
git-lfs \ |
|
|
openssl \ |
|
|
jq \ |
|
|
python3-pip \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir \ |
|
|
huggingface_hub \ |
|
|
datasets |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ |
|
|
CMD curl -f http://localhost:7860/ || exit 1 |
|
|
|
|
|
COPY Caddyfile /app/Caddyfile |
|
|
|
|
|
|
|
|
COPY sync_storage.py /app/sync_storage.py |
|
|
COPY start_with_sync.sh /start.sh |
|
|
|
|
|
|
|
|
RUN chmod +x /app/sync_storage.py /start.sh |
|
|
|
|
|
|
|
|
RUN openlist_url=$(curl -X 'GET' 'https://api.github.com/repos/OpenListTeam/OpenList/releases' -H 'accept: application/json' | jq -r '.[0].assets[] | .browser_download_url | select(. | endswith("linux-amd64.tar.gz"))') && \ |
|
|
echo download OpenList from $openlist_url && \ |
|
|
wget $openlist_url -O /tmp/openlist.tar.gz && \ |
|
|
mkdir -p /tmp/openlist && \ |
|
|
tar xvf /tmp/openlist.tar.gz -C /tmp/openlist && \ |
|
|
cp -r /tmp/openlist /app/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN caddy_url=$(curl -X 'GET' 'https://api.github.com/repos/caddyserver/caddy/releases' -H 'accept: application/json' | jq -r '.[0].assets[] | .browser_download_url | select(. | endswith("linux_amd64.tar.gz"))') && \ |
|
|
echo download caddy from $caddy_url && \ |
|
|
wget $caddy_url -O /tmp/caddy.tar.gz && \ |
|
|
mkdir -p /tmp/caddy && \ |
|
|
tar xvf /tmp/caddy.tar.gz -C /tmp/caddy && \ |
|
|
cp -r /tmp/caddy /app/ |
|
|
|
|
|
RUN chmod -R 755 /app |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ |
|
|
CMD curl -f http://localhost:7860/ || exit 1 |
|
|
|
|
|
|
|
|
ENTRYPOINT ["/start.sh"] |
|
|
|
|
|
|
|
|
|