forked from AbsolutOD/shortly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (28 loc) · 812 Bytes
/
Dockerfile
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
FROM python:3.10-slim-buster as python
ARG POETRY_VERSION=1.3.2
ENV \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONFAULTHANDLER=1
WORKDIR /app
FROM python as poetry
# Configure Poetry
ENV \
POETRY_VERSION=$POETRY_VERSION \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1 \
POETRY_CACHE_DIR=/opt/.cache
# RUN mkdir $POETRY_HOME
RUN pip3 install poetry
# Install dependencies
COPY poetry.lock pyproject.toml /app/
COPY . /app/
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi -vvv
#FROM python as runtime
### copy the app over
#COPY --from=poetry /app /app
EXPOSE 8000
# runs the production server
ENTRYPOINT ["poetry", "run"]
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]