Spaces:
Sleeping

decompilai / Dockerfile
ejschwartz's picture
Build DecompilAI Gradio Space
f51c192
Raw History Blame Contribute Delete
1.68 kB
# 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"]