dockerizing the project
This commit is contained in:
33
dockerfile
Normal file
33
dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
# Use the official Python runtime image
|
||||
FROM python:3.13-slim
|
||||
|
||||
# Create the app directory
|
||||
RUN mkdir /app
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /app
|
||||
|
||||
# Set environment variables
|
||||
# Prevents Python from writing pyc files to disk
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
#Prevents Python from buffering stdout and stderr
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Upgrade pip
|
||||
RUN pip install --upgrade pip
|
||||
|
||||
# Copy the Django project and install dependencies
|
||||
COPY requirements.txt /app/
|
||||
|
||||
# run this command to install all dependencies
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
# Copy the Django project to the container
|
||||
COPY . /app/
|
||||
|
||||
# Expose the Django port
|
||||
EXPOSE 8000
|
||||
|
||||
ENTRYPOINT [ "/Entrypoint.sh" ]
|
||||
# Run Django’s development server
|
||||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
|
||||
Reference in New Issue
Block a user