-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (20 loc) · 967 Bytes
/
Dockerfile
File metadata and controls
25 lines (20 loc) · 967 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
ARG PYTHON_VERSION
FROM python:${PYTHON_VERSION}
# virtualenv 21 moves some functions that 1.14 hatch depended on. For now, just
# pin to 20.X so hatch env continues working.
RUN pip install hatch==1.14.0 "virtualenv<21"
# Add only the minimal files required to be able to pre-create the hatch environments.
# If any of these files changes, a new Docker build is necessary. This is why we need
# to only include the minimal set of files.
ADD pyproject.toml /working/pyproject.toml
ADD LICENSE.txt /working/LICENSE.txt
ADD README.md /working/README.md
ADD src/kaggle/__init__.py /working/src/kaggle/__init__.py
WORKDIR /working
# Pre-create the hatch environments.
# This drastically cut the time to run commands with the `docker-hatch` wrapper
# since the creation of the environments (including syncing dependencies) is
# only done once when building this image and is skipped later.
RUN hatch env create default
RUN hatch env create lint
ENTRYPOINT ["hatch"]