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
|
FROM node:22-alpine
|
||||||
|
|
||||||
RUN apk add --no-cache openssl=3.5.8-r0
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY ./package.json ./package.json
|
# Copy source code from the repository
|
||||||
COPY ./package-lock.json ./package-lock.json
|
COPY . .
|
||||||
|
|
||||||
RUN npm ci --ignore-scripts
|
# Install ALL dependencies (including dev deps needed for build)
|
||||||
|
RUN npm ci
|
||||||
COPY ./src ./src
|
|
||||||
COPY ./tsconfig.json ./tsconfig.json
|
|
||||||
|
|
||||||
|
# Build the project
|
||||||
RUN npm run build
|
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
|
# Start the pre-built MCP server directly (don't rebuild)
|
||||||
|
CMD ["node", "dist/index.js", "--transport", "http"]
|
||||||
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"]
|
|
||||||
+2
-2
@@ -32,7 +32,7 @@ type Configuration = {
|
|||||||
const state: Configuration & { ready: boolean } = {
|
const state: Configuration & { ready: boolean } = {
|
||||||
transport: 'stdio',
|
transport: 'stdio',
|
||||||
port: 8080,
|
port: 8080,
|
||||||
host: '127.0.0.1',
|
host: '0.0.0.0',
|
||||||
braveApiKey: process.env.BRAVE_API_KEY ?? '',
|
braveApiKey: process.env.BRAVE_API_KEY ?? '',
|
||||||
loggingLevel: 'info',
|
loggingLevel: 'info',
|
||||||
ready: false,
|
ready: false,
|
||||||
@@ -81,7 +81,7 @@ export function getOptions(): Configuration | false {
|
|||||||
.option(
|
.option(
|
||||||
'--host <string>',
|
'--host <string>',
|
||||||
'desired host for HTTP transport',
|
'desired host for HTTP transport',
|
||||||
process.env.BRAVE_MCP_HOST ?? '127.0.0.1'
|
process.env.BRAVE_MCP_HOST ?? '0.0.0.0'
|
||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
'--allowed-origins <origins...>',
|
'--allowed-origins <origins...>',
|
||||||
|
|||||||
Reference in new issue
Block a user