-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 816 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (25 loc) · 816 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
FROM python:3.10.6-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DJANGO_SETTINGS_MODULE=core.settings.railway
WORKDIR /code
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt /code/
RUN pip install --upgrade pip && \
pip install -r requirements.txt && \
pip install gunicorn whitenoise
# Copy project
COPY . /code/
# Create directories
RUN mkdir -p /code/church/static /code/church/media
WORKDIR /code/church
# Run migrations and collectstatic, then start server
CMD python manage.py migrate --noinput && \
python manage.py collectstatic --noinput && \
gunicorn core.wsgi:application --bind 0.0.0.0:$PORT --workers 4