Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse filesRe-Write the Docker
- Dockerfile +14 -3
Dockerfile
CHANGED
@@ -1,15 +1,26 @@
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
-
#
|
|
|
|
|
|
|
|
|
4 |
RUN apt-get update && \
|
5 |
apt-get install -y cppcheck clang-tidy && \
|
6 |
rm -rf /var/lib/apt/lists/*
|
7 |
|
8 |
-
|
9 |
COPY requirements.txt .
|
|
|
|
|
10 |
RUN pip install --no-cache-dir -r requirements.txt
|
11 |
|
|
|
12 |
COPY app.py .
|
13 |
|
|
|
14 |
EXPOSE 7860
|
15 |
-
|
|
|
|
|
|
1 |
+
# Use the official Python 3.10 slim image as a parent image
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Install system dependencies including cppcheck and clang-tidy
|
8 |
+
# This is done in a single RUN layer to reduce image size
|
9 |
RUN apt-get update && \
|
10 |
apt-get install -y cppcheck clang-tidy && \
|
11 |
rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
+
# Copy the requirements file into the container at /app
|
14 |
COPY requirements.txt .
|
15 |
+
|
16 |
+
# Install any needed packages specified in requirements.txt
|
17 |
RUN pip install --no-cache-dir -r requirements.txt
|
18 |
|
19 |
+
# Copy the application script into the container at /app
|
20 |
COPY app.py .
|
21 |
|
22 |
+
# Make port 7860 available to the world outside this container
|
23 |
EXPOSE 7860
|
24 |
+
|
25 |
+
# Define the command to run the application
|
26 |
+
CMD ["python", "app.py"]
|