Spaces:
Sleeping
Sleeping
andrewammann
commited on
Create Dockerfile
Browse files- Dockerfile +24 -0
Dockerfile
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10
|
2 |
+
|
3 |
+
# Create a non-root user
|
4 |
+
RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser
|
5 |
+
|
6 |
+
# Set the working directory
|
7 |
+
WORKDIR /app
|
8 |
+
|
9 |
+
# Copy the requirements file and install dependencies
|
10 |
+
COPY requirements.txt .
|
11 |
+
RUN pip install -r requirements.txt
|
12 |
+
|
13 |
+
# Copy the rest of the application code
|
14 |
+
COPY . .
|
15 |
+
|
16 |
+
# Set environment variables
|
17 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
18 |
+
ENV PYTHONUNBUFFERED=1
|
19 |
+
|
20 |
+
# Expose the port
|
21 |
+
EXPOSE 7860
|
22 |
+
|
23 |
+
# Run the application
|
24 |
+
CMD ["gunicorn", "app:server", "-b", "0.0.0.0:7860", "--workers=1"]
|