Skip to content

adding Dockerfile. adding github action to push image to ecr. #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.devcontainer/*
.github/*
41 changes: 41 additions & 0 deletions .github/workflows/docker_build_and_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Build and Push
on:
push:
branches:
- main

env:
ECR_REGISTRY: "709825985650.dkr.ecr.us-east-1.amazonaws.com/launchdarkly/mcp"
jobs:
build_push_image:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: zvonimirsun/read-package-version-actions@v2
id: get-semver
- uses: aws-actions/configure-aws-credentials@v4
with:
audience: "https://github.com/launchdarkly"
role-to-assume: "arn:aws:iam::011970158519:role/mcp-server-ecr-publisher"
role-session-name: "McpServerPublish"
aws-region: "us-east-1"
- uses: aws-actions/amazon-ecr-login@v2
with:
registries: "709825985650"
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
tags: |
${{ format('{0}:{1}', env.ECR_REGISTRY, steps.get-semver.outputs.version) }}
labels: |
org.opencontainers.image.title="mcp-server"
org.opencontainers.image.description="LaunchDarkly MCP Server"
org.opencontainers.image.version=${{ steps.get-semver.outputs.version }}
push: ${{ github.ref == 'refs/heads/main' }}
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM oven/bun:1-debian AS builder

WORKDIR /app

COPY package*.json ./

RUN bun install

COPY . .

RUN bun run build

FROM gcr.io/distroless/nodejs24-debian12:970bec506fed86941afb61c21983f25b3b3fe68c

WORKDIR /app

# Copy built application from builder stage
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/bin ./bin
COPY --from=builder /app/package.json ./

EXPOSE 8080
ENTRYPOINT ["/nodejs/bin/node", "/app/bin/mcp-server.js", "start", "--transport", "sse", "--port", "8080"]
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,28 @@ Then, configure your server definition to reference your local clone. For exampl
}
```

### Installation steps for Docker

If installing the MCP server from the AWS Markeplace, pull the image using an authenticated role using the provided instructions in the marketplace listing.

To run the container:

```bash
docker run --rm -p 8080:8080 709825985650.dkr.ecr.us-east-1.amazonaws.com/launchdarkly/mcp --api-key api-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```

Then, configure your server definition to reference your local clone. For example:

```json
{
"mcpServers": {
"launchdarkly": {
"url": "http://localhost:8080/sse"
}
}
}
```

<!-- Start Requirements [requirements] -->
## Requirements

Expand Down