-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (44 loc) · 1.24 KB
/
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
FROM python:3.11-slim-bullseye as base
ENV PIP_VERSION=23.2.1
ENV PDM_VERSION=2.9.1
ENV PDM_USE_VENV=no
ENV PYTHONPATH=/app/__pypackages__/3.11/lib
WORKDIR /app
COPY ./pyproject.toml .
COPY ./pdm.lock .
# for pyproject.toml to extract version
COPY ./featureflags_client/__init__.py ./featureflags_client/__init__.py
# for pyproject.toml to read readme
COPY ./README.md .
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libpq-dev \
gcc \
make \
g++ \
git && \
# install tools
pip install --upgrade pip==${PIP_VERSION} && \
pip install pdm==${PDM_VERSION} && \
# configure
pdm config cache_dir /pdm_cache && \
pdm config check_update false && \
# install base deps \
pdm install --no-lock --prod --no-editable && \
# cleanup base layer to keep image size small
apt purge --auto-remove -y \
gcc \
make \
g++ \
git && \
rm -rf /var/cache/apt && \
rm -rf /var/lib/apt/list && \
rm -rf $HOME/.cache
FROM base as dev
RUN pdm install --no-lock -G dev -G lint --no-editable
FROM dev as examples
RUN pdm install --no-lock -G examples
FROM dev as test
RUN pdm install --no-lock -G test
FROM base as docs
RUN pdm install --no-lock -G docs