31 lines
815 B
Docker
31 lines
815 B
Docker
FROM python:3.12-slim
|
|
|
|
# Prevents Python from writing pyc files to disc (equivalent to python -B option)
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
# Prevents Python from buffering stdout and stderr (equivalent to python -u option)
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# set work directory
|
|
WORKDIR /usr/src/app/
|
|
|
|
# set time
|
|
RUN ln -fs /usr/share/zoneinfo/Europe/Madrid /etc/localtime
|
|
RUN dpkg-reconfigure -f noninteractive tzdata
|
|
|
|
# install software
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# install dependencies
|
|
RUN pip3 install --upgrade pip
|
|
|
|
COPY ./requirements.txt .
|
|
RUN pip3 install -r requirements.txt
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
|
|
#CMD ["daphne", "-b", "0.0.0.0", "-p", "8000", "myproject.asgi:application"]
|