Skip to content

Commit 07187da

Browse files
committed
Add a Dockerfile to run with Docker
Signed-off-by: David Gageot <[email protected]>
1 parent 9449810 commit 07187da

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.dockerignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Node modules (we'll install fresh in the image)
2+
node_modules
3+
npm-debug.log
4+
yarn-error.log
5+
6+
# Logs
7+
logs
8+
*.log
9+
10+
# Environment files (optional for security)
11+
.env
12+
.env.*
13+
14+
# OS & editor junk
15+
.DS_Store
16+
Thumbs.db
17+
*.swp
18+
*.swo
19+
.idea
20+
.vscode
21+
22+
# Test coverage / build artifacts
23+
coverage
24+
dist
25+
build
26+
tmp
27+
.cache
28+
29+
# Git
30+
.git
31+
.gitignore
32+
33+
# Dockerignore itself (not needed inside the image)
34+
.dockerignore

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM node:23.11-alpine AS builder
2+
3+
WORKDIR /app
4+
COPY . ./
5+
COPY tsconfig.json /tsconfig.json
6+
RUN --mount=type=cache,target=/root/.npm npm install
7+
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
8+
9+
FROM node:23.11-alpine AS release
10+
WORKDIR /app
11+
COPY --from=builder /app/dist /app/dist
12+
COPY --from=builder /app/package.json /app/package.json
13+
COPY --from=builder /app/package-lock.json /app/package-lock.json
14+
ENV NODE_ENV=production
15+
RUN npm ci --ignore-scripts --omit-dev
16+
ENTRYPOINT ["node", "dist/index.js"]

0 commit comments

Comments
 (0)