30 lines
707 B
Docker
30 lines
707 B
Docker
FROM python:3.12-slim-bookworm
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_NO_CACHE_DIR=1
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
libjpeg62-turbo-dev \
|
|
zlib1g-dev \
|
|
libpq-dev \
|
|
cron \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install -r requirements.txt
|
|
|
|
COPY . .
|
|
RUN chmod +x docker/entrypoint-api.sh docker/entrypoint-cron.sh \
|
|
&& mkdir -p /app/data /app/media /app/staticfiles \
|
|
&& cp docker/crontab /etc/cron.d/newdashboard \
|
|
&& chmod 0644 /etc/cron.d/newdashboard \
|
|
&& crontab /etc/cron.d/newdashboard
|
|
|
|
EXPOSE 8000
|
|
|
|
ENTRYPOINT ["./docker/entrypoint-api.sh"]
|