| FROM python:3.8-slim-buster |
|
|
| ENV PYTHONUNBUFFERED=1 \ |
| PYTHONDONTWRITEBYTECODE=1 \ |
| PORT=7860 \ |
| DATABASE_URL=sqlite:////data/db.sqlite3 |
|
|
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| gcc \ |
| python3-dev \ |
| curl \ |
| libsqlite3-dev \ |
| && rm -rf /var/lib/apt/lists/* \ |
| && mkdir -p /data /static \ |
| && chmod 777 /data /static |
|
|
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| COPY . . |
|
|
| |
| RUN python manage.py collectstatic --noinput --settings=dtb.settings_build |
|
|
| COPY entrypoint.sh /entrypoint.sh |
| RUN chmod +x /entrypoint.sh |
|
|
| CMD ["/entrypoint.sh"] |