-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (19 loc) · 961 Bytes
/
Dockerfile
File metadata and controls
28 lines (19 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM python:3.11.3
ARG GITHUB_REPO
LABEL org.opencontainers.image.source=https://github.com/${GITHUB_REPO}
WORKDIR /api
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
DJANGO_SETTINGS_MODULE=api.settings
COPY requirements.txt ./requirements.txt
RUN python -m pip install --upgrade pip && \
# Ensure setuptools/pkg_resources are installed in the final image.
python -m pip install --no-cache-dir --force-reinstall "setuptools<82" && \
python -m pip install --no-cache-dir -r requirements.txt
# Fail fast if image doesn't contain setuptools/pkg_resources.
RUN python -c "import pkg_resources; print('pkg_resources ok')"
COPY . .
CMD ["sh", "-c", "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn api.wsgi -c gunicorn/config.py && python manage.py runserver" ]
#ENTRYPOINT python manage.py migrate && \
# python manage.py collectstatic --noinput && \
# gunicorn api.wsgi -c gunicorn/config.py