-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 867 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (27 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Use official Python runtime as a parent image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
WORKDIR /app
# Install system dependencies (needed for psycopg2 and others)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
netcat-traditional \
&& rm -rf /var/lib/apt/lists/*
# Install python dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy project files
COPY . /app/
# Make entrypoint executable
RUN chmod +x /app/entrypoint.sh
# Expose port
EXPOSE 8080
# Set the entrypoint
ENTRYPOINT ["/app/entrypoint.sh"]
# Default command to start the server (Render will bind to $PORT natively)
CMD sh -c "gunicorn taskmates.wsgi:application --bind 0.0.0.0:${PORT:-8080}"