Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
74ffd5f
fix: add ECR authentication to release workflow for golden base images
scale-ballen Mar 17, 2026
3df7ec0
fix: replace private ECR base image with public python:3.12-slim-book…
scale-ballen Mar 18, 2026
1e9dbf4
fix: remove stale ECR auth, add Trivy scanning to release workflow
scale-ballen Mar 18, 2026
5d9e3c8
fix: upgrade base image to python:3.12-slim-trixie to eliminate OS vulns
scale-ballen Mar 18, 2026
142cb98
fix: bump deps to resolve HIGH CVEs (PyJWT, protobuf, python-multipar…
scale-ballen Mar 18, 2026
8723ae7
revert: remove build-agentex.yml workflow changes
scale-ballen Mar 18, 2026
17410a2
fix: resolve merge conflict with PR #170 (Chainguard base image)
scale-ballen Mar 18, 2026
692af8e
fix: bump pyasn1 and tornado to resolve HIGH CVEs
scale-ballen Mar 18, 2026
95288f0
fix: align uv version in Dockerfile with CI workflow (0.6.9 → 0.7.3)
scale-ballen Mar 18, 2026
d299fe1
feat: upgrade agentex-sdk from 0.4.18 to 0.9.4
scale-ballen Mar 18, 2026
c8e93cd
fix: use >= instead of == for agentex-sdk version constraint
scale-ballen Mar 18, 2026
f95b8b2
fix: eliminate all HIGH/CRITICAL CVEs from Docker images
scale-ballen Mar 18, 2026
deaed11
Merge branch 'main' into fix/release-workflow-ecr-auth
scale-ballen Mar 18, 2026
ac3dd78
fix: remove libvips-dev and fix NODE_ENV ordering in agentex-ui Docke…
scale-ballen Mar 18, 2026
cc6d5e4
fix: remove minimatch/glob overrides that break eslint-plugin-import
scale-ballen Mar 19, 2026
6a2e45b
fix: copy alembic CLI binary to production stage
scale-ballen Mar 19, 2026
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
72 changes: 43 additions & 29 deletions agentex-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
# NOTE: -dev variant required at runtime for libvips (Sharp image processing)
FROM cgr.dev/chainguard/node:latest-dev
ARG SOURCE_DIR=public/agentex-ui
ENTRYPOINT []
# Build stage — install build deps, build the Next.js app
FROM node:20-trixie-slim AS builder
ARG SOURCE_DIR=agentex-ui

# Install dependencies as root
USER root
RUN apk add --no-cache \
libvips-dev \
# Install system dependencies for native modules (node-gyp)
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
make \
build-base
g++ \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Set Sharp to use system libvips
ENV SHARP_IGNORE_GLOBAL_LIBVIPS=0

# Set production environment
# Disable telemetry during build
ENV NEXT_TELEMETRY_DISABLED=1

# Copy package files
Expand All @@ -25,37 +20,56 @@ COPY ${SOURCE_DIR}/package.json ${SOURCE_DIR}/package-lock.json ./
ENV npm_config_cache=/tmp/.npm
RUN npm config set maxsockets 3

# Install all dependencies (including dev) needed for build
# Install all dependencies (including dev for build tooling)
RUN npm config set registry https://registry.npmjs.org/ && \
npm ci --verbose

# Copy source code (node_modules and .next excluded by .dockerignore)
# Copy source code
COPY ${SOURCE_DIR} .
COPY LICENSE /app/LICENSE

# Build the application (creates fresh .next directory)
# Set production environment for the build step
ENV NODE_ENV=production

# Build the application
RUN npm run build

# Remove dev dependencies after build
RUN npm prune --omit=dev
RUN npm prune --production

# Production stage — clean image without build tools
FROM node:20-trixie-slim AS production
ENTRYPOINT []

WORKDIR /app

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"

# Verify build output exists and show final structure
RUN echo "=== Build verification ===" && \
ls -la .next/ && \
echo "=== Final container structure ===" && \
ls -la /app/
# Remove npm and its bundled vulnerable deps (tar, glob, minimatch, cross-spawn)
# npm is not needed at runtime — we run next start directly via node
RUN npm cache clean --force && \
rm -rf /usr/local/lib/node_modules/npm /usr/local/bin/npm /usr/local/bin/npx

# Use Chainguard's default nonroot user (65532)
RUN chown -R 65532:65532 /app
# Copy built application from builder (no build tools, no dev deps)
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/next.config.ts ./
COPY --from=builder /app/LICENSE ./LICENSE

# Create nonroot user and set ownership
RUN groupadd --system --gid 65532 nonroot && \
useradd --system --uid 65532 --gid nonroot nonroot && \
chown -R nonroot:nonroot /app

# Switch to non-root user
USER 65532

EXPOSE 3000

ENV PORT=3000
ENV HOSTNAME="0.0.0.0"

# Start the application
CMD ["npm", "start"]
# Start the application directly via node (no npm needed)
CMD ["node", "node_modules/.bin/next", "start"]
4 changes: 4 additions & 0 deletions agentex-ui/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const nextConfig: NextConfig = {
];
},
devIndicators: false,
eslint: {
// ESLint runs in CI; skip during Docker build to avoid native binding issues
ignoreDuringBuilds: true,
},
};

export default nextConfig;
Loading
Loading