-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 994 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (27 loc) · 994 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
# Use Python official image
FROM python:3.12-slim
ARG VERSION_STR
# Set it as an environment variable so Python can see it
ENV VERSION_STR=$VERSION_STR
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Optional: Print it during build to verify
RUN echo "Building version: $VERSION_STR"
# Set work directory
WORKDIR /app
# Install system-level dependencies
RUN apt-get update && apt-get install -y tzdata && \
ln -fs /usr/share/zoneinfo/America/Indiana/Indianapolis /etc/localtime && \
dpkg-reconfigure --frontend noninteractive tzdata
COPY requirements.txt /app/
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy project
COPY . /app/
RUN python3 manage.py collectstatic --noinput
# Expose port
EXPOSE 8000
# Rebuild your image after these changes!
# Use the full path for the command
CMD ["gunicorn", "volunteer_tracker_app.wsgi:application", "--bind", "0.0.0.0:8000"]
#CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]