Pratyush-01 commited on
Commit
c5fa5d5
·
verified ·
1 Parent(s): 12e2f97

Add .dockerignore so BuildKit ignores host node_modules

Browse files
Files changed (1) hide show
  1. .dockerignore +53 -0
.dockerignore ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Patterns excluded from the Docker build context.
2
+ #
3
+ # Distinct from .openenvignore: that one filters the openenv-push upload
4
+ # to the HF Space repo. THIS file filters what `docker build` (and HF's
5
+ # BuildKit) actually sees when running COPY directives.
6
+ #
7
+ # Both are needed because:
8
+ # 1. .openenvignore keeps junk out of the Hub repo (browsable in UI).
9
+ # 2. .dockerignore keeps the SAME junk out of the BuildKit context
10
+ # even when shipped — without this, an earlier failed deploy left
11
+ # `frontend/node_modules` on the Space's git, and `COPY frontend/`
12
+ # collided with the freshly-installed in-image node_modules:
13
+ # ERROR: cannot copy to non-directory:
14
+ # /.../buildkit/.../build/node_modules/@types/katex
15
+ #
16
+ # The fix: never let host node_modules into the build context, period.
17
+
18
+ # Frontend dev artefacts. Stage 1 of the Dockerfile reinstalls node_modules
19
+ # from package.json + pnpm-lock.yaml; whatever the host has should not
20
+ # leak into the COPY frontend/ step that runs after pnpm install.
21
+ frontend/node_modules
22
+ frontend/dist
23
+ frontend/dist-ts-build
24
+
25
+ # Python venv / caches. These are huge and useless inside the image.
26
+ .venv
27
+ **/__pycache__
28
+ **/*.pyc
29
+ **/*.pyo
30
+ .pytest_cache
31
+ .ruff_cache
32
+ .mypy_cache
33
+
34
+ # Training stack. Built into a separate HF Job image; not needed at
35
+ # Space runtime.
36
+ train
37
+
38
+ # Tests + dev docs. Keep the build context focused on runtime code.
39
+ tests
40
+ docs
41
+
42
+ # Build / packaging artefacts.
43
+ *.egg-info
44
+ build
45
+ dist
46
+
47
+ # IDE / OS detritus.
48
+ .DS_Store
49
+ *.swp
50
+ .vscode
51
+ .idea
52
+ .git
53
+ .github