Skip to content

Commit b2644c6

Browse files
committed
fixed
1 parent 7a84682 commit b2644c6

3 files changed

Lines changed: 34 additions & 11 deletions

File tree

.env.sample

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# --- Configurable defaults ---
2+
APP_NAME="bon-calculadora-mcp-js"
3+
MAINTAINER="Alpha Hack Group <alpha@github.com>"
4+
DESCRIPTION="BON Calculadora MCP Server - Model Context Protocol server para calculadora de BON"
5+
SOURCE="https://github.com/alpha-hack-program/bon-calculadora-mcp-js.git"
6+
27
BASE_TAG="9.6"
38
BASE_IMAGE="registry.access.redhat.com/ubi9/nodejs-22-minimal"
49
CACHE_FLAG=""

Containerfile

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FROM ${BASE_IMAGE}:${BASE_TAG} as builder
77

88
# Add metadata labels
99
LABEL stage=builder
10-
LABEL description="Build stage for weather-mcp application"
10+
LABEL description="Build stage for MCP Server application"
1111

1212
WORKDIR /opt/app-root/src
1313

@@ -33,22 +33,27 @@ RUN npm ci && \
3333
FROM ${BASE_IMAGE}:${BASE_TAG}
3434

3535
# Build arguments available in production stage
36+
ARG APP_NAME
3637
ARG BASE_IMAGE
3738
ARG BASE_TAG
38-
ARG VERSION=latest
39+
ARG VERSION
3940
ARG BUILD_DATE
4041
ARG VCS_REF
42+
ARG MAINTAINER
43+
ARG DESCRIPTION
44+
ARG SOURCE
45+
ARG PORT=8000
4146

4247
# Metadata labels for the final image
43-
LABEL maintainer="Your Name <your.email@example.com>"
48+
LABEL maintainer="${MAINTAINER}"
4449
LABEL version="${VERSION}"
45-
LABEL description="Weather MCP Server - Model Context Protocol server for weather data"
46-
LABEL org.opencontainers.image.title="weather-mcp"
47-
LABEL org.opencontainers.image.description="Weather MCP Server"
50+
LABEL description="${DESCRIPTION}"
51+
LABEL org.opencontainers.image.title="${APP_NAME}"
52+
LABEL org.opencontainers.image.description="${DESCRIPTION}"
4853
LABEL org.opencontainers.image.version="${VERSION}"
4954
LABEL org.opencontainers.image.created="${BUILD_DATE}"
5055
LABEL org.opencontainers.image.revision="${VCS_REF}"
51-
LABEL org.opencontainers.image.source="https://github.com/your-org/weather-mcp"
56+
LABEL org.opencontainers.image.source="${SOURCE}"
5257
LABEL org.opencontainers.image.base.name="${BASE_IMAGE}:${BASE_TAG}"
5358

5459
# Copy built application from builder stage
@@ -67,8 +72,8 @@ ENV PATH=/opt/app-root/src/node_modules/.bin:$PATH
6772
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
6873
CMD node -e "console.log('Health check passed')" || exit 1
6974

70-
# Expose 8000
71-
EXPOSE 8000
75+
# Expose PORT
76+
EXPOSE ${PORT}
7277

7378
# Default command using supergateway for stdio transport
74-
CMD ["npx", "-y", "supergateway", "--stdio", "node build/index.js"]
79+
CMD ["npx", "-y", "supergateway", "--stdio", "node build/index.js"]

image.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ else
1717
fi
1818

1919
# Default values and computed variables
20-
APP_NAME="${APP_NAME:-weather-mcp}"
20+
APP_NAME="${APP_NAME:-test-mcp}"
21+
MAINTAINER="${MAINTAINER-test@acme.com}"
22+
DESCRIPTION="${DESCRIPTION-"Test MCP Server"}"
2123
VERSION="${VERSION:-$(git rev-parse --short HEAD 2>/dev/null || echo 'latest')}"
2224
IMAGE_TAG="${REGISTRY}/${APP_NAME}:${VERSION}"
2325
LATEST_TAG="${REGISTRY}/${APP_NAME}:latest"
2426
CONTAINERFILE="${CONTAINERFILE:-Containerfile}"
27+
SOURCE="${SOURCE:-https://github.com/acme/test-mcp.git}"
2528

2629
# Colors for output
2730
RED='\033[0;31m'
@@ -96,6 +99,11 @@ build() {
9699
"--build-arg" "VERSION=${VERSION}"
97100
"--build-arg" "BUILD_DATE=${build_date}"
98101
"--build-arg" "VCS_REF=${vcs_ref}"
102+
"--build-arg" "MAINTAINER=${MAINTAINER}"
103+
"--build-arg" "DESCRIPTION=${DESCRIPTION}"
104+
"--build-arg" "APP_NAME=${APP_NAME}"
105+
"--build-arg" "PORT=${PORT}"
106+
"--build-arg" "SOURCE=${SOURCE}"
99107
)
100108

101109
# Add cache flag if specified
@@ -112,6 +120,11 @@ build() {
112120
log_info " VERSION=${VERSION}"
113121
log_info " BUILD_DATE=${build_date}"
114122
log_info " VCS_REF=${vcs_ref:0:8}"
123+
log_info " MAINTAINER=${MAINTAINER}"
124+
log_info " DESCRIPTION=${DESCRIPTION}"
125+
log_info " APP_NAME=${APP_NAME}"
126+
log_info " PORT=${PORT}"
127+
log_info " SOURCE=${SOURCE}"
115128

116129
if "$(get_runtime)" build "${build_args[@]}"; then
117130
log_success "Build completed successfully"

0 commit comments

Comments
 (0)