-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
58 lines (29 loc) · 1020 Bytes
/
Dockerfile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
# Use the official Python base image
FROM python:3.13-bookworm AS base
# Set the working directory in the container
WORKDIR /src
# Install build-essential
RUN apt-get update && apt-get install -y build-essential
# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
ADD https://github.com/bitwarden/sdk/releases/download/bws-v0.4.0/bws-x86_64-unknown-linux-gnu-0.4.0.zip /tmp
RUN unzip /tmp/bws-x86_64-unknown-linux-gnu-0.4.0.zip
RUN mv bws /usr/local/bin
RUN rm -r /tmp/
FROM base AS dev
COPY . .
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements-dev.txt
EXPOSE 8000
ENTRYPOINT ["python3", "app/entry.py" ]
CMD dev
FROM dev AS test
CMD ["pytest"]
FROM base as prod
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
COPY ./app ./app
EXPOSE 8000
# Start the FastAPI application
ENTRYPOINT ["/bin/python3", "app/entry.py"]
CMD []