# Dockerfile for deploying ACF with mcp-proxy bridge
# Converts STDIO-based ACF server to HTTP/SSE without code changes
FROM node:18-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# mcp-proxy will be available via npx, no need for global install
# Copy package files first for better caching
COPY package*.json ./
# Install ACF dependencies
RUN npm ci --production
# Copy the entire ACF project
COPY . .
# Install Playwright browsers and Linux dependencies (best effort)
RUN npx playwright install --with-deps || true
# Create data directory for workspace
RUN mkdir -p /data /tmp
# Copy proxy configuration
COPY mcp-proxy-config.yaml ./
# Create a non-root user for security
RUN groupadd -r acf && useradd -r -g acf acf
RUN chown -R acf:acf /app /data /tmp
USER acf
# Expose the proxy port
EXPOSE 8080
# Health check for deployment platforms
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# Environment variables for production
ENV NODE_ENV=production
ENV WORKSPACE_ROOT=/data
ENV ALLOWED_DIRS=/data:/tmp
ENV ACF_PATH=/app
# Start mcp-proxy with ACF server
CMD ["npx", "mcp-proxy", "--port", "8080", "--", "node", "./bin/agentic-control-framework-mcp", "--workspaceRoot", "/data"]