-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (26 loc) · 923 Bytes
/
Copy pathDockerfile
File metadata and controls
45 lines (26 loc) · 923 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
42
43
44
45
FROM python:3.10.5-slim as requirements
WORKDIR /temp
COPY pyproject.toml poetry.lock* /temp/
RUN pip install poetry
RUN poetry export -o requirements.txt --without-hashes
# Отвечает за создание среды
FROM python:3.10.5-slim as builder
RUN apt-get update; \
apt-get install -y --no-install-recommends \
libpq-dev \
libc-dev \
gcc;
# Отвечает за создание приложения
FROM builder AS build_app
WORKDIR /project
COPY --from=requirements /temp/requirements.txt requirements.txt
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY ./app ./app
RUN mkdir logs; \
mkdir logs/app
COPY marketplace_dump.json .
WORKDIR /project/app
# это переопределено в docker-compose, так как нужна статика и миграции
CMD [ "python3", "app.py" ]