-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
30 lines (21 loc) · 739 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
FROM python:3.9
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Accept build arguments for GitHub token
ARG GITHUB_TOKEN
# Use the GitHub token during pip install
RUN git config --global url."https://${GITHUB_TOKEN}:[email protected]/".insteadOf "https://github.com/"
# Debugging: Print the GITHUB_TOKEN during the build process
RUN echo "GITHUB_TOKEN=${GITHUB_TOKEN}"
# Copy requirements.txt
COPY requirements.txt .
# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY . .
# Running migrations
RUN python manage.py migrate
# gunicorn command
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]