Compare commits
14
Commits
e4866a959a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09f1056303 | ||
|
|
58118ee576 | ||
|
|
ad29d5ba19 | ||
|
|
b24f89e78d | ||
|
|
01aebf9e02 | ||
|
|
678c84ebd3 | ||
|
|
917106eab5 | ||
|
|
e45fb9121a | ||
|
|
941e77bfa0 | ||
|
|
a72cde84c7 | ||
|
|
af3c9082bc | ||
|
|
b994bae485 | ||
|
|
095b2fabb8 | ||
|
|
573c13a467 |
No files matched your search
@@ -0,0 +1,28 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone https://gitea.samson.media/samson-media/brave-search-mcp-server.git .
|
||||
git checkout ${{ github.sha }}
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t gitea.samson.media/samson-media/brave-search-mcp-server:latest .
|
||||
docker build -t "gitea.samson.media/samson-media/brave-search-mcp-server:${GITHUB_SHA:0:7}" .
|
||||
|
||||
- name: Log in and push
|
||||
run: |
|
||||
echo "${{ secrets.CI_TOKEN }}" | docker login -u ci@samson.media --password-stdin gitea.samson.media
|
||||
docker push gitea.samson.media/samson-media/brave-search-mcp-server:latest
|
||||
docker push "gitea.samson.media/samson-media/brave-search-mcp-server:${GITHUB_SHA:0:7}"
|
||||
+12
-29
@@ -1,38 +1,21 @@
|
||||
FROM node:alpine@sha256:5209bcaca9836eb3448b650396213dbe9d9a34d31840c2ae1f206cb2986a8543 AS builder
|
||||
|
||||
RUN apk add --no-cache openssl=3.5.8-r0
|
||||
FROM node:22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./package.json ./package.json
|
||||
COPY ./package-lock.json ./package-lock.json
|
||||
# Copy source code from the repository
|
||||
COPY . .
|
||||
|
||||
RUN npm ci --ignore-scripts
|
||||
|
||||
COPY ./src ./src
|
||||
COPY ./tsconfig.json ./tsconfig.json
|
||||
# Install ALL dependencies (including dev deps needed for build)
|
||||
RUN npm ci
|
||||
|
||||
# Build the project
|
||||
RUN npm run build
|
||||
|
||||
FROM node:alpine@sha256:5209bcaca9836eb3448b650396213dbe9d9a34d31840c2ae1f206cb2986a8543 AS release
|
||||
# Now prune dev dependencies
|
||||
RUN npm prune --production
|
||||
|
||||
RUN apk add --no-cache openssl=3.5.8-r0
|
||||
# Expose the MCP server port
|
||||
EXPOSE 8080
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/dist /app/dist
|
||||
COPY --from=builder /app/package.json /app/package.json
|
||||
COPY --from=builder /app/package-lock.json /app/package-lock.json
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# The server defaults to binding 127.0.0.1 for safe local execution. Inside a
|
||||
# container the port must be reachable through the published mapping, so bind to
|
||||
# all interfaces here. Deployments can still override BRAVE_MCP_HOST.
|
||||
ENV BRAVE_MCP_HOST=0.0.0.0
|
||||
|
||||
RUN npm ci --ignore-scripts --omit-dev
|
||||
|
||||
USER node
|
||||
|
||||
ENTRYPOINT ["node", "dist/index.js"]
|
||||
# Start the pre-built MCP server directly (don't rebuild)
|
||||
CMD ["node", "dist/index.js", "--transport", "http"]
|
||||
+2
-2
@@ -32,7 +32,7 @@ type Configuration = {
|
||||
const state: Configuration & { ready: boolean } = {
|
||||
transport: 'stdio',
|
||||
port: 8080,
|
||||
host: '127.0.0.1',
|
||||
host: '0.0.0.0',
|
||||
braveApiKey: process.env.BRAVE_API_KEY ?? '',
|
||||
loggingLevel: 'info',
|
||||
ready: false,
|
||||
@@ -81,7 +81,7 @@ export function getOptions(): Configuration | false {
|
||||
.option(
|
||||
'--host <string>',
|
||||
'desired host for HTTP transport',
|
||||
process.env.BRAVE_MCP_HOST ?? '127.0.0.1'
|
||||
process.env.BRAVE_MCP_HOST ?? '0.0.0.0'
|
||||
)
|
||||
.option(
|
||||
'--allowed-origins <origins...>',
|
||||
|
||||
Reference in new issue
Block a user