Skip to content

Commit c425793

Browse files
committed
fix(docker): exclude tests from production build
1 parent 78c6487 commit c425793

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ COPY package.json ./
1010
# Delete lockfile to force Linux native binary resolution
1111
RUN rm -f package-lock.json && npm install --legacy-peer-deps
1212

13+
1314
# Copy source
1415
COPY . .
1516

17+
# Remove test folders before build
18+
RUN rm -rf src/tests src/__tests__
19+
1620
# Build
1721
RUN npm run build
1822

tsconfig.app.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,12 @@
3838
"include": [
3939
"src"
4040
]
41+
,
42+
"exclude": [
43+
"node_modules",
44+
"dist",
45+
"src/tests",
46+
"src/__tests__",
47+
"**/*.test.ts"
48+
]
4149
}

0 commit comments

Comments
 (0)