MogensR commited on
Commit
8e44c27
·
verified ·
1 Parent(s): 07f632a

Delete Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +0 -103
Dockerfile DELETED
@@ -1,103 +0,0 @@
1
- # ===============================
2
- # BackgroundFX Pro — Final Dockerfile
3
- # CUDA 12.1.1 + PyTorch 2.5.1 + Matplotlib 3.5.0 + NumPy 1.21.6
4
- # ===============================
5
- ARG PYTHON_VERSION=3.10
6
- FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
7
- # ---- Environment Setup ----
8
- ENV DEBIAN_FRONTEND=noninteractive \
9
- PYTHONUNBUFFERED=1 \
10
- PYTHONDONTWRITEBYTECODE=1 \
11
- PIP_NO_CACHE_DIR=1 \
12
- PIP_DISABLE_PIP_VERSION_CHECK=1 \
13
- TORCH_CUDA_ARCH_LIST="7.5 8.0 8.6+PTX" \
14
- CUDA_VISIBLE_DEVICES="0" \
15
- OMP_NUM_THREADS=2 \
16
- OPENBLAS_NUM_THREADS=1 \
17
- MKL_NUM_THREADS=1 \
18
- NUMEXPR_NUM_THREADS=1 \
19
- HF_HOME=/home/user/app/.hf \
20
- TORCH_HOME=/home/user/app/.torch \
21
- PORT=7860 \
22
- STREAMLIT_SERVER_PORT=7860 \
23
- STREAMLIT_SERVER_HEADLESS=true \
24
- STREAMLIT_BROWSER_GATHER_USAGE_STATS=false \
25
- PYTHONPATH=/home/user/app:/home/user/app/pipeline:/home/user/app/models \
26
- FFMPEG_BIN=ffmpeg \
27
- SAM2_DEVICE=cuda \
28
- MATANY_DEVICE=cuda \
29
- TF_CPP_MIN_LOG_LEVEL=2 \
30
- SAM2_CHECKPOINT=/home/user/app/checkpoints/sam2.1_hiera_large.pt
31
- # ---- Non-root User ----
32
- RUN useradd -m -u 1000 user
33
- ENV HOME=/home/user
34
- WORKDIR $HOME/app
35
- # ---- System Dependencies ----
36
- RUN apt-get update && apt-get install -y --no-install-recommends \
37
- git wget curl ca-certificates \
38
- python3 python3-pip python3-venv python3-dev \
39
- build-essential gcc g++ pkg-config \
40
- libffi-dev libssl-dev libc6-dev \
41
- libgl1-mesa-glx libglib2.0-0 libsm6 libxext6 libxrender1 libgomp1 \
42
- libopus0 libvpx7 libsrtp2-1 libx264-dev libx265-dev libmp3lame-dev \
43
- libblas-dev liblapack-dev gfortran \
44
- libfreetype6-dev libpng-dev libjpeg-dev \
45
- && rm -rf /var/lib/apt/lists/*
46
- # ---- Install FFmpeg ----
47
- RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg \
48
- && rm -rf /var/lib/apt/lists/*
49
- # ---- Python Bootstrap ----
50
- RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel
51
- # ---- Install NumPy 1.21.6 ----
52
- RUN python3 -m pip install --no-cache-dir numpy==1.21.6
53
- # ---- Install Matplotlib 3.5.0 (Compatible with NumPy 1.21.6) ----
54
- RUN python3 -m pip install --no-cache-dir matplotlib==3.5.0
55
- # ---- Install PyTorch 2.5.1 (CUDA 12.1) ----
56
- RUN python3 -m pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cu121 \
57
- torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 \
58
- && python3 -c "import torch; print('PyTorch:', torch.__version__); print('CUDA available:', torch.cuda.is_available())"
59
- # ---- Copy Requirements ----
60
- COPY requirements.txt .
61
- RUN python3 -m pip install --no-cache-dir -r requirements.txt
62
- # ---- Install MatAnyone ----
63
- RUN echo "Installing MatAnyone..." && \
64
- python3 -m pip install --no-cache-dir git+https://github.com/pq-yang/MatAnyone.git \
65
- && python3 -c "import matanyone; print('✅ MatAnyone installed')"
66
- # ---- Install SAM2 (Editable) ----
67
- RUN echo "Installing SAM2..." && \
68
- git clone --depth=1 https://github.com/facebookresearch/segment-anything-2.git third_party/sam2 && \
69
- cd third_party/sam2 && \
70
- python3 -m pip install --no-cache-dir -e .
71
- # ---- Download SAM2 Checkpoints ----
72
- RUN mkdir -p /home/user/app/checkpoints && \
73
- wget -q --show-progress -O /home/user/app/checkpoints/sam2.1_hiera_large.pt \
74
- https://dl.fbaipublicfiles.com/segment_anything_2/092824/sam2.1_hiera_large.pt
75
- # ---- Create Directory Structure ----
76
- RUN mkdir -p /home/user/app/pipeline /home/user/app/models /home/user/app/storage && \
77
- chown -R user:user /home/user/app && \
78
- chmod -R 755 /home/user/app
79
- # ---- Copy Application Code ----
80
- COPY --chown=user:user . .
81
- # ---- Healthcheck ----
82
- HEALTHCHECK --interval=30s --timeout=8s --retries=3 CMD \
83
- python3 -c "import numpy; print('NumPy:', numpy.__version__); import matplotlib; print('Matplotlib:', matplotlib.__version__); import torch; print('PyTorch:', torch.__version__)"
84
- # ---- Runtime Startup ----
85
- USER user
86
- EXPOSE 7860
87
- CMD ["sh", "-c", "\
88
- echo '===========================================' && \
89
- echo '=== BACKGROUNDFX PRO STARTUP ===' && \
90
- echo '===========================================' && \
91
- echo 'Disk free: $(df -h /home/user/app/storage | tail -1)' && \
92
- python3 --version && \
93
- pip --version && \
94
- ffmpeg -version && \
95
- if [ -f streamlit_app.py ]; then \
96
- python3 -c 'import streamlit_app; print(\"✅ streamlit_app.py imports OK\")'; \
97
- else \
98
- echo '❌ ERROR: streamlit_app.py not found!' && exit 1; \
99
- fi && \
100
- exec streamlit run --server.port=${PORT} --server.address=0.0.0.0 \
101
- --server.maxUploadSize=200 --server.enableCORS=false \
102
- --server.enableXsrfProtection=false --logger.level=debug \
103
- streamlit_app.py"]