dockerize applicaiton

This commit is contained in:
Kamil Grabowski committed 2025-06-24 17:42:23 +02:00
1 parent 13b0fcb0f5
commit 4200625b1d
2 files changed
+30 -8

No files matched your search

+14 -8
View File
@@ -1,14 +1,18 @@
FROM node:22.16-alpine AS builder
# Must be entire project because `prepare` script is run during `npm install` and requires all files.
COPY src/ /app/src
COPY tsconfig.json /tsconfig.json
FROM node:22.16.0-bookworm-slim@sha256:048ed02c5fd52e86fda6fbd2f6a76cf0d4492fd6c6fee9e2c463ed5108da0e34 AS builder
WORKDIR /app
RUN --mount=type=cache,target=/root/.npm npm install
COPY ./package.json ./package.json
COPY ./package-lock.json ./package-lock.json
FROM node:22-alpine AS release
RUN npm ci --ignore-scripts
COPY ./src ./src
COPY ./tsconfig.json ./tsconfig.json
RUN npm run build
FROM node:22.16.0-bookworm-slim@sha256:048ed02c5fd52e86fda6fbd2f6a76cf0d4492fd6c6fee9e2c463ed5108da0e34 AS release
WORKDIR /app
@@ -20,4 +24,6 @@ ENV NODE_ENV=production
RUN npm ci --ignore-scripts --omit-dev
ENTRYPOINT ["node", "dist/index.js"]
USER node
CMD ["node", "dist/index.js", "--host", "0.0.0.0", "--port", "8080", "--transport", "http"]
+16
View File
@@ -0,0 +1,16 @@
services:
mcp-server:
build: .
cap_drop:
- all
deploy:
restart_policy:
condition: any
delay: 5s
environment:
- BRAVE_API_KEY
init: true
ports:
- 8080:8080
security_opt:
- no-new-privileges:true