Spaces:
Runtime error
Runtime error
change method
Browse files- Dockerfile +12 -14
Dockerfile
CHANGED
|
@@ -1,34 +1,32 @@
|
|
| 1 |
-
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.10-slim-buster
|
| 3 |
|
| 4 |
-
# Set the working directory in the container to /app
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy the current directory contents into the container at /app
|
| 8 |
COPY . /app
|
| 9 |
|
| 10 |
-
# Install git and any other dependencies you might need
|
| 11 |
RUN apt-get update && \
|
| 12 |
apt-get install -y --no-install-recommends git && \
|
| 13 |
apt-get clean && \
|
| 14 |
rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
-
|
| 17 |
-
RUN pip install poetry gradio
|
| 18 |
|
| 19 |
RUN git config --global --add safe.directory /app
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
RUN git submodule update --init --recursive
|
| 23 |
-
cd /app/olas-predict-benchmark/benchmark && git checkout fix/mech-packages && cd ../.. && \
|
| 24 |
-
cd /app/olas-predict-benchmark/benchmark/mech && git checkout main && cd ../../..
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
-
RUN chmod +x /app/start.sh
|
| 32 |
|
| 33 |
-
# Run app.py when the container launches
|
| 34 |
CMD ["/app/start.sh"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim-buster
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
COPY . /app
|
| 6 |
|
|
|
|
| 7 |
RUN apt-get update && \
|
| 8 |
apt-get install -y --no-install-recommends git && \
|
| 9 |
apt-get clean && \
|
| 10 |
rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
RUN pip install poetry gradio
|
|
|
|
| 13 |
|
| 14 |
RUN git config --global --add safe.directory /app
|
| 15 |
|
| 16 |
+
# Separately handle submodule update and checks
|
| 17 |
+
RUN git submodule update --init --recursive
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
# Check if the directory exists before attempting to cd
|
| 20 |
+
RUN if [ -d "/app/olas-predict-benchmark/benchmark" ]; then \
|
| 21 |
+
cd /app/olas-predict-benchmark/benchmark && git checkout fix/mech-packages; \
|
| 22 |
+
fi
|
| 23 |
+
|
| 24 |
+
RUN if [ -d "/app/olas-predict-benchmark/benchmark/mech" ]; then \
|
| 25 |
+
cd /app/olas-predict-benchmark/benchmark/mech && git checkout main; \
|
| 26 |
+
fi
|
| 27 |
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
+
RUN chmod +x /app/start.sh
|
| 31 |
|
|
|
|
| 32 |
CMD ["/app/start.sh"]
|