Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +20 -3
Dockerfile
CHANGED
@@ -3,14 +3,31 @@
|
|
3 |
|
4 |
FROM python:3.9
|
5 |
|
|
|
6 |
RUN useradd -m -u 1000 user
|
7 |
-
|
8 |
WORKDIR /app
|
9 |
|
|
|
10 |
COPY --chown=user ./requirements.txt requirements.txt
|
11 |
-
|
12 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
COPY --chown=user . /app
|
15 |
|
16 |
-
|
|
|
|
3 |
|
4 |
FROM python:3.9
|
5 |
|
6 |
+
# Create a new user and set the working directory
|
7 |
RUN useradd -m -u 1000 user
|
|
|
8 |
WORKDIR /app
|
9 |
|
10 |
+
# Copy and install Python dependencies
|
11 |
COPY --chown=user ./requirements.txt requirements.txt
|
|
|
12 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
13 |
|
14 |
+
# Install specific versions of PyTorch and other dependencies
|
15 |
+
RUN pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118 \
|
16 |
+
&& pip install -U xformers --index-url https://download.pytorch.org/whl/cu118
|
17 |
+
|
18 |
+
# Clone and install the modified gaussian splatting repository
|
19 |
+
RUN git clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization \
|
20 |
+
&& pip install ./diff-gaussian-rasterization
|
21 |
+
|
22 |
+
# Install nvdiffrast for mesh extraction
|
23 |
+
RUN pip install git+https://github.com/NVlabs/nvdiffrast
|
24 |
+
|
25 |
+
# Create a directory for pretrained models and download the model
|
26 |
+
RUN mkdir /app/pretrained && cd /app/pretrained \
|
27 |
+
&& wget https://huggingface.co/ashawkey/LGM/resolve/main/model_fp16_fixrot.safetensors
|
28 |
+
|
29 |
+
# Copy the application code
|
30 |
COPY --chown=user . /app
|
31 |
|
32 |
+
# Set the command to run the application
|
33 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|