-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (23 loc) · 872 Bytes
/
Dockerfile
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
# syntax=docker/dockerfile:1
FROM python:3
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH=/app
WORKDIR /app
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Add PostgreSQL APT repository to install PostgreSQL 16 client tools
RUN apt-get update && \
apt-get install -y wget gnupg2 lsb-release && \
wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
apt-get update && \
apt-get install -y postgresql-client-16
COPY . /app/
# Collect static files
RUN python manage.py collectstatic --noinput
# Expose port
EXPOSE 8002
# Start the server
CMD ["gunicorn", "dravenverse.wsgi:application", "--bind", "0.0.0.0:8002"]