Update Dockerfile
Browse files- Dockerfile +18 -3
Dockerfile
CHANGED
@@ -1,15 +1,30 @@
|
|
1 |
# Use an official Python runtime as a parent image
|
2 |
FROM python:3.10-slim
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Copy only the requirements file
|
8 |
COPY requirements.txt /app/
|
9 |
|
10 |
# Install any needed packages specified in requirements.txt
|
11 |
-
RUN pip install --no-cache-dir --upgrade pip
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
# Copy the current directory contents into the container
|
15 |
COPY . /app
|
|
|
1 |
# Use an official Python runtime as a parent image
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
+
# Install system dependencies
|
5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
6 |
+
build-essential \
|
7 |
+
libpq-dev \
|
8 |
+
gcc \
|
9 |
+
&& rm -rf /var/lib/apt/lists/*
|
10 |
+
|
11 |
# Set the working directory in the container
|
12 |
WORKDIR /app
|
13 |
|
14 |
+
# Copy only the requirements file to leverage Docker cache
|
15 |
COPY requirements.txt /app/
|
16 |
|
17 |
# Install any needed packages specified in requirements.txt
|
18 |
+
RUN pip install --no-cache-dir --upgrade pip
|
19 |
+
|
20 |
+
# Install gunicorn separately to capture any errors
|
21 |
+
RUN pip install --no-cache-dir gunicorn
|
22 |
+
|
23 |
+
# Install the rest of the requirements
|
24 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
25 |
+
|
26 |
+
# Verify gunicorn installation
|
27 |
+
RUN which gunicorn
|
28 |
|
29 |
# Copy the current directory contents into the container
|
30 |
COPY . /app
|