Spaces:
Runtime error
Runtime error
updates
Browse files- Dockerfile +13 -16
Dockerfile
CHANGED
@@ -1,35 +1,32 @@
|
|
|
|
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 |
-
|
|
|
|
|
15 |
|
16 |
-
#
|
17 |
-
|
18 |
-
# RUN git submodule update --init --recursive
|
19 |
-
|
20 |
-
# # Check if the directory exists before attempting to cd
|
21 |
-
# RUN if [ -d "/app/olas-predict-benchmark" ]; then \
|
22 |
-
# cd /app/olas-predict-benchmark && git checkout fix/mech-packages; \
|
23 |
-
# fi
|
24 |
-
|
25 |
-
# RUN if [ -d "/app/olas-predict-benchmark/benchmark/mech" ]; then \
|
26 |
-
# cd /app/olas-predict-benchmark/benchmark/mech && git checkout main; \
|
27 |
-
# fi
|
28 |
|
|
|
29 |
EXPOSE 7860
|
30 |
|
31 |
-
RUN ls -la /app
|
32 |
-
|
33 |
RUN chmod +x /app/start.sh
|
34 |
|
35 |
-
|
|
|
|
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 system dependencies
|
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 |
+
# Install Python dependencies
|
17 |
RUN pip install poetry gradio
|
18 |
|
19 |
+
# Create a non-root user and change ownership of the /app directory
|
20 |
+
RUN adduser --disabled-password --gecos '' myuser && \
|
21 |
+
chown -R myuser:myuser /app
|
22 |
|
23 |
+
# Switch to the non-root user
|
24 |
+
USER myuser
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
# Expose the port Gradio runs on
|
27 |
EXPOSE 7860
|
28 |
|
|
|
|
|
29 |
RUN chmod +x /app/start.sh
|
30 |
|
31 |
+
# Run the start script when the container launches
|
32 |
+
CMD ["/app/start.sh"]
|