-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 751 Bytes
/
Dockerfile
File metadata and controls
39 lines (27 loc) · 751 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
FROM python:3.9-slim-buster as compile-image
RUN apt-get update && apt-get install -y \
libpq-dev\
gcc\
curl\
liblzma-dev
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100\
POETRY_VERSION=1.1.4 \
POETRY_HOME="/usr/poetry" \
POETRY_VIRTUALENVS_CREATE=false\
PATH="/usr/poetry/bin:${PATH}"
WORKDIR /usr/src/app
RUN pip install --upgrade pip
RUN pip install poetry
COPY pyproject.toml /usr/src/app/
RUN poetry install --no-dev
# ------------------------------------------
FROM compile-image
ENV PYTHONPATH=$PYTHONPATH:/usr/src/app
COPY . /usr/src/app/
WORKDIR /usr/src/app/
EXPOSE 3000
CMD python -m unittest