File size: 1,106 Bytes
3b8a335 a4163f3 3b8a335 97618dc 3b8a335 19c7575 3b8a335 97618dc 19c7575 97618dc 3b8a335 19c7575 3b8a335 97618dc 3b8a335 a4163f3 d23178a 3b8a335 5db5412 97618dc 3b8a335 97618dc 3b8a335 a4163f3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | FROM python:3.11-slim
WORKDIR /app
# System deps + wget
RUN apt-get update && apt-get install -y \
git \
curl \
ca-certificates \
wget \
&& rm -rf /var/lib/apt/lists/*
# opencode CLI – robust mit curl + retry
RUN set -eux; \
for i in 1 2 3; do \
echo "Downloading opencode v1.3.17 (attempt $i)..." ; \
curl -fL --retry 3 --retry-delay 2 -o opencode.deb "https://github.com/anomalyco/opencode/releases/download/v1.3.17/opencode-desktop-linux-amd64.deb" && break || sleep 5; \
done; \
dpkg -i opencode.deb || apt-get install -f -y; \
rm -f opencode.deb; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
echo "== opencode version =="; opencode --version || true
# Python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# App Code (achtet .dockerignore)
COPY . /app
# Fix permissions for entrypoint
RUN chmod +x /app/start.sh
# Workspace
RUN mkdir -p /workspace
EXPOSE 7860
ENV HF_SPACE=true PORT=7860
# Use start.sh as entrypoint (sets up opencode config, then execs uvicorn)
ENTRYPOINT ["/app/start.sh"]
|