Spaces:
Sleeping
Sleeping
File size: 1,679 Bytes
f51c192 | 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 | # syntax=docker/dockerfile:1
FROM ubuntu:24.04 AS upstream
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && apt-get update && apt-get install -y --no-install-recommends ca-certificates git
RUN --mount=type=secret,id=git_ca,target=/run/secrets/git_ca \
if [ -f /run/secrets/git_ca ]; then export GIT_SSL_CAINFO=/run/secrets/git_ca; fi \
&& git init /opt/decompilai \
&& git -C /opt/decompilai fetch --depth=1 https://github.com/Shreyas652/DecompilAI.git 69cba22981778b46ee672f550eb6a8bbaaae9213 \
&& git -C /opt/decompilai checkout --detach FETCH_HEAD \
&& rm -rf /opt/decompilai/.git
FROM ubuntu:24.04
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && apt-get update && apt-get install -y --no-install-recommends \
ca-certificates clang-18 llvm-18 libclang-rt-18-dev gcc libc6-dev python3-venv \
&& ln -s /usr/bin/clang-18 /usr/local/bin/clang \
&& python3 -m venv /opt/venv \
&& rm -rf /var/lib/apt/lists/*
ENV PATH=/opt/venv/bin:$PATH \
PYTHONPATH=/opt/decompilai \
DECOMPILAI_ROOT=/opt/decompilai \
GRADIO_ANALYTICS_ENABLED=False \
VDEC_CACHE=/tmp/decompilai-cache
WORKDIR /opt/app
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
COPY --from=upstream /opt/decompilai/decompilai /opt/decompilai/decompilai
COPY --from=upstream /opt/decompilai/examples /opt/decompilai/examples
COPY --from=upstream /opt/decompilai/LICENSE /opt/decompilai/NOTICE /opt/decompilai/
COPY app.py .
COPY examples examples
USER ubuntu
EXPOSE 7860
CMD ["python", "app.py"]
|