dockerizing the project

This commit is contained in:
=
2025-12-30 23:05:57 +03:30
parent 17522d57cd
commit 46240a6c38
3 changed files with 77 additions and 8 deletions

33
dockerfile Normal file
View 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 Djangos development server
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]