Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jifollan authored and GitHub Enterprise committed Mar 20, 2025
1 parent b10e9f0 commit 7dcbb32
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ FROM python:3.12-slim

# Allows docker to cache installed dependencies between builds
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Set Google's DNS and install dependencies in the same RUN command
RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf && \
pip install --no-cache-dir -r requirements.txt

# Mounts the application code to the image
COPY . app
Expand All @@ -12,4 +15,4 @@ WORKDIR /app
EXPOSE 8000

# Runs migrations and starts the production server
CMD ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"]
CMD ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"]

0 comments on commit 7dcbb32

Please sign in to comment.