Spaces:
Running
Running
Commit
·
9b6ff65
1
Parent(s):
4fdab3c
newdocker
Browse files- Dockerfile +14 -16
Dockerfile
CHANGED
@@ -1,28 +1,26 @@
|
|
1 |
-
# Use
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
-
#
|
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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
18 |
COPY requirements.txt .
|
19 |
RUN pip install --no-cache-dir -r requirements.txt
|
20 |
|
21 |
-
# Copy
|
22 |
COPY . .
|
23 |
|
24 |
-
# Set environment
|
25 |
ENV PORT=8080
|
26 |
|
27 |
-
#
|
|
|
|
|
|
|
28 |
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
|
|
|
1 |
+
# Use official Python image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
+
# Set working directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Install system dependencies
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
libgl1-mesa-glx \
|
10 |
+
&& rm -rf /var/lib/apt/lists/*
|
11 |
+
|
12 |
+
# Install Python dependencies
|
13 |
COPY requirements.txt .
|
14 |
RUN pip install --no-cache-dir -r requirements.txt
|
15 |
|
16 |
+
# Copy app files
|
17 |
COPY . .
|
18 |
|
19 |
+
# Set environment variable for port
|
20 |
ENV PORT=8080
|
21 |
|
22 |
+
# Expose the port (optional, Railway handles it)
|
23 |
+
EXPOSE 8080
|
24 |
+
|
25 |
+
# Start the app using Gunicorn, binding to 0.0.0.0:$PORT
|
26 |
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
|