-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (26 loc) · 1.01 KB
/
Copy pathDockerfile
File metadata and controls
35 lines (26 loc) · 1.01 KB
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
FROM python:3.10-slim
WORKDIR /app
# Устанавливаем системные утилиты, необходимые для инструментов (lsof, postgres client)
RUN apt-get update && apt-get install -y \
lsof \
net-tools \
curl \
python3-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Копируем проект
COPY . /app/
# Устанавливаем зависимости и сам пакет через pip (poetry не ставим ради простоты демо)
RUN pip install --no-cache-dir build && \
pip install -e .
# Слушаем порт 8000
EXPOSE 8000
# Создаем скрипт запуска и выдаем права
COPY entrypoint.sh /app/entrypoint.sh
RUN sed -i 's/\r$//' /app/entrypoint.sh && chmod +x /app/entrypoint.sh
# Создаем не-root пользователя
RUN useradd -m devboostuser
RUN chown -R devboostuser:devboostgroup /app || chown -R devboostuser /app
USER devboostuser
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["serve"]