-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (34 loc) · 946 Bytes
/
Copy pathDockerfile
File metadata and controls
44 lines (34 loc) · 946 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
37
38
39
40
41
42
43
44
# Base image: Debian 12 with Python 3.11
FROM python:3.11-slim-bookworm
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DJANGO_SETTINGS_MODULE=snowsune.settings
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
python3-dev \
python3-psycopg2 \
gettext \
cron \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install pip dependencies
COPY requirements.txt .
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Make entrypoint executable
RUN chmod +x bin/entrypoint.sh
# Collect static files
RUN python manage.py collectstatic --noinput
# Bake in the git revision
ARG GIT_COMMIT
ENV GIT_COMMIT=$GIT_COMMIT
# Expose port
EXPOSE 80
# Entrypoint
ENTRYPOINT ["/bin/sh", "bin/entrypoint.sh"]