Skip to content

Commit 1398e4a

Browse files
adding Dockerfile. adding github action to push image to ecr.
1 parent 3b8016e commit 1398e4a

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.devcontainer/*
2+
.github/*
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker Build and Push
2+
permissions:
3+
checks: write
4+
contents: write
5+
pull-requests: write
6+
statuses: write
7+
id-token: write
8+
"on":
9+
push:
10+
jobs:
11+
build_push_image:
12+
runs-on: ubuntu-latest
13+
needs: test_and_lint
14+
permissions:
15+
id-token: write
16+
contents: read
17+
steps:
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
- uses: launchdarkly/common-actions/init@main
20+
- uses: launchdarkly/common-actions/short-sha@main
21+
id: short-sha
22+
- uses: launchdarkly/common-actions/aws-auth@main
23+
with:
24+
role-session-name: 'McpServer'
25+
ecr-login: 'true'
26+
iam-role-arn: 'arn:aws:iam::011970158519:role/mcp-server-ecr-publisher'
27+
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
28+
with:
29+
context: .
30+
file: Dockerfile
31+
platforms: linux/amd64,linux/arm64
32+
tags: |
33+
${{ format('{0}/launchdarkly/mcp:{1}', '709825985650.dkr.ecr.us-east-1.amazonaws.com', steps.short-sha.outputs.sha) }}
34+
labels: |
35+
org.opencontainers.image.title="mcp-server"
36+
org.opencontainers.image.description="LaunchDarkly MCP Server"
37+
org.opencontainers.image.version=${{ steps.short-sha.outputs.sha }}
38+
push: ${{ github.ref == 'refs/heads/main' }}

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM node:24-bookworm-slim AS builder
2+
3+
WORKDIR /app
4+
5+
RUN npm install -g bun
6+
7+
COPY package*.json ./
8+
9+
RUN bun install
10+
11+
COPY . .
12+
13+
RUN npm run build
14+
15+
FROM gcr.io/distroless/nodejs24-debian12:970bec506fed86941afb61c21983f25b3b3fe68c
16+
17+
WORKDIR /app
18+
19+
# Copy built application from builder stage
20+
COPY --from=builder /app/dist ./dist
21+
COPY --from=builder /app/bin ./bin
22+
COPY --from=builder /app/package.json ./
23+
24+
EXPOSE 8080
25+
ENTRYPOINT ["/nodejs/bin/node", "/app/bin/mcp-server.js", "start", "--transport", "sse", "--port", "8080"]

0 commit comments

Comments
 (0)