Spaces:
Running
Running
Commit
·
4fdab3c
1
Parent(s):
b1f386d
change docker
Browse files- Dockerfile +16 -13
Dockerfile
CHANGED
@@ -1,25 +1,28 @@
|
|
1 |
-
#
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
-
#
|
5 |
-
RUN apt-get update && \
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
11 |
|
12 |
WORKDIR /app
|
13 |
|
14 |
-
#
|
15 |
COPY requirements.txt .
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
-
#
|
19 |
COPY . .
|
20 |
|
21 |
-
#
|
22 |
-
ENV PORT
|
23 |
|
24 |
-
#
|
25 |
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
|
|
|
1 |
+
# Use a slim Python image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
+
# Install OS-level dependencies
|
5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
6 |
+
build-essential \
|
7 |
+
libglib2.0-0 \
|
8 |
+
libsm6 \
|
9 |
+
libxrender1 \
|
10 |
+
libxext6 \
|
11 |
+
libgl1 \
|
12 |
+
python3-setuptools \
|
13 |
+
&& rm -rf /var/lib/apt/lists/*
|
14 |
|
15 |
WORKDIR /app
|
16 |
|
17 |
+
# Copy and install dependencies
|
18 |
COPY requirements.txt .
|
19 |
RUN pip install --no-cache-dir -r requirements.txt
|
20 |
|
21 |
+
# Copy the rest of the app
|
22 |
COPY . .
|
23 |
|
24 |
+
# Set environment port (Railway uses it)
|
25 |
+
ENV PORT=8080
|
26 |
|
27 |
+
# Start the app
|
28 |
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
|