-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (26 loc) · 1017 Bytes
/
Dockerfile
File metadata and controls
41 lines (26 loc) · 1017 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
29
30
31
32
33
34
35
36
37
38
39
40
41
# ---- Base Stage ----
FROM python:latest as base
LABEL title="DynaTable"
LABEL description="DynaTable is an innovative dynamic model builder tailored for Django, equipped with a potent REST API interface."
LABEL version="0.0.1"
LABEL author="Mateusz Solnica (blooser@protonmail.com)"
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /app
COPY poetry.lock pyproject.toml /app/
RUN pip install --upgrade pip && pip install poetry && poetry config virtualenvs.create false
RUN poetry install --no-dev --no-interaction --no-ansi
# ---- Copy Stage ----
FROM base as copy-stage
COPY . /app
# ---- Development Stage ----
FROM copy-stage as development
EXPOSE 8000
ENV DJANGO_SETTINGS_MODULE=dynatable.settings
CMD ["python", "app/src/manage.py", "runserver", "0.0.0.0:8000"]
# ---- Production Stage ----
FROM copy-stage as production
EXPOSE 8000
ENV DJANGO_SETTINGS_MODULE=dynatable.settings
RUN python /app/src/manage.py
CMD ["gunicorn", "dynatable.wsgi:application", "--bind", "0.0.0.0:8000"]