-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (22 loc) · 790 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (22 loc) · 790 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
FROM python:3.12.6-slim AS builder
ARG EXPORT_FLAG="--with dev"
RUN pip install --upgrade pip poetry poetry-plugin-export
COPY pyproject.toml poetry.lock ./
RUN poetry export -f requirements.txt $EXPORT_FLAG --without-hashes --output /tmp/requirements.txt
FROM python:3.12.6-slim
WORKDIR /app
RUN groupadd -g 10000 app && \
useradd -g app -d /app -u 10000 app && \
chown app:app /app && \
apt-get update && \
apt upgrade -y && \
apt-get install nano && \
apt-get install -y git && \
pip install --upgrade pip
COPY --from=builder /tmp/requirements.txt .
RUN pip install -r requirements.txt
RUN pip install watchdog
COPY . .
USER app
ENV PYTHONPATH="/app"
CMD ["watchmedo", "auto-restart", "--pattern=*.py", "--recursive", "--", "python", "examples/test_flow.py"]