-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (27 loc) · 822 Bytes
/
Copy pathDockerfile
File metadata and controls
40 lines (27 loc) · 822 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
FROM python:3.12-slim AS base
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r requirements.txt
FROM base AS runtime
COPY --chmod=755 entrypoint.sh /app/entrypoint.sh
COPY alembic.ini /app/alembic.ini
COPY migrations /app/migrations
COPY app /app/app
EXPOSE 8000
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["python", "-m", "app"]
FROM base AS test
COPY requirements-dev.txt .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r requirements-dev.txt
COPY --chmod=755 entrypoint.sh /app/entrypoint.sh
COPY alembic.ini /app/alembic.ini
COPY migrations /app/migrations
COPY app /app/app
COPY tests /app/tests
COPY pytest.ini /app/pytest.ini
COPY .env.test /app/.env.test
CMD ["pytest", "-q"]