-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
26 lines (24 loc) · 999 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
# Slim image can't install numpy
FROM python:3.11.4-bookworm as production
WORKDIR /workspace
# setuptools 65.3.0 can't lock package defined its dependencies by pyproject.toml
RUN pip install --upgrade setuptools>=65.4.0
COPY Pipfile Pipfile.lock /workspace/
# see:
# - Fail to pipenv update due to MetadataGenerationFailed · Issue #5377 · pypa/pipenv
# https://github.com/pypa/pipenv/issues/5377
RUN pip --no-cache-dir install pipenv==2023.7.23 \
&& pipenv install --deploy --system \
&& pip uninstall -y pipenv virtualenv-clone virtualenv
COPY . /workspace
ENTRYPOINT [ "python3", "convert.py" ]
FROM production as development
# see: https://pythonspeed.com/articles/activate-virtualenv-dockerfile/
ENV PIPENV_VENV_IN_PROJECT=1
# see:
# - Fail to pipenv update due to MetadataGenerationFailed · Issue #5377 · pypa/pipenv
# https://github.com/pypa/pipenv/issues/5377
RUN pip --no-cache-dir install pipenv==2023.7.23 \
&& pipenv sync --dev
ENTRYPOINT [ "pipenv", "run" ]
CMD ["pytest"]