What Dockerfiles Are Included in Kaneo: Complete Container Setup Guide

Yes, the Kaneo monorepo includes three Dockerfiles located at the repository root, apps/api/, and apps/web/ that enable full containerization of the platform's backend, frontend, and base infrastructure.

Each Dockerfile in the usekaneo/kaneo repository serves a distinct purpose in the containerization strategy. Whether you're deploying a single service or orchestrating the complete stack with Docker Compose, understanding these files is essential for production deployments.

Overview of Kaneo's Dockerfile Structure

Kaneo follows a monorepo pattern with dedicated containerization for each major component. The three Dockerfiles work together to support modular, scalable deployments.

Dockerfile Location Service Purpose
Dockerfile.kaneo (root) Base image Foundation for custom multi-service builds and shared dependencies
apps/api/Dockerfile Backend API Hono/Node.js runtime with production dependency management
apps/web/Dockerfile Frontend web React/Vite static build served by lightweight web server

Root Dockerfile: Base Infrastructure

The Dockerfile.kaneo at the repository root provides a foundational image. This Dockerfile supports scenarios where you need a common base layer across services or want to extend Kaneo with custom tooling.

Build the base image locally:

docker build -f Dockerfile.kaneo -t kaneo-base:latest .

apps/api/Dockerfile: Backend API Containerization

The apps/api/Dockerfile packages the Hono-based backend API service. This Dockerfile handles Node.js dependency installation, build steps, and runtime environment configuration.

Key characteristics of the API Dockerfile:

  • Runtime: Node.js with production-optimized dependency layer
  • Framework: Hono web framework for high-performance API endpoints
  • Context: Builds from repository root to access shared packages and configuration

Build the API service:

docker build -f apps/api/Dockerfile -t kaneo-api:latest .

Run the containerized API:

docker run -p 3000:3000 --env-file .env kaneo-api:latest

apps/web/Dockerfile: Frontend Web Containerization

The apps/web/Dockerfile produces a production-ready static bundle from the React/Vite frontend application. The final stage uses a lightweight web server to serve built assets efficiently.

Key characteristics of the web Dockerfile:

  • Build tool: Vite for fast bundling and optimization
  • Output: Static HTML/CSS/JS assets
  • Server: Minimal web server for production asset delivery

Build the web frontend:

docker build -f apps/web/Dockerfile -t kaneo-web:latest .

Run the containerized frontend:

docker run -p 80:80 kaneo-web:latest

Deployment Patterns Using Kaneo Dockerfiles

Single-Service Development

For isolated development of one component, build and run individual Dockerfiles:


# API only

docker build -f apps/api/Dockerfile -t kaneo-api:dev .
docker run -p 3000:3000 -v $(pwd)/apps/api:/app kaneo-api:dev

# Web only

docker build -f apps/web/Dockerfile -t kaneo-web:dev .
docker run -p 5173:5173 -v $(pwd)/apps/web:/app kaneo-web:dev

Full-Stack Production Deployment

Combine all three Dockerfiles in a Docker Compose configuration for complete platform deployment. The base Dockerfile can serve as a shared build stage when optimizing image layers across services.


# Example docker-compose.yml structure

services:
  api:
    build:
      context: .
      dockerfile: apps/api/Dockerfile
    ports:
      - "3000:3000"
  web:
    build:
      context: .
      dockerfile: apps/web/Dockerfile
    ports:
      - "80:80"
    depends_on:
      - api

Key Files Reference

Summary

  • Three Dockerfiles in Kaneo enable complete platform containerization: root base (Dockerfile.kaneo), API service (apps/api/Dockerfile), and web frontend (apps/web/Dockerfile)
  • Modular architecture supports independent service deployment or unified Docker Compose orchestration
  • Production-optimized builds separate dependency installation from runtime for efficient layer caching
  • Framework-specific configurations handle Hono/Node.js backend and React/Vite frontend build requirements

Frequently Asked Questions

Does Kaneo provide a Docker Compose file for full-stack deployment?

The repository structure with separated apps/api/Dockerfile and apps/web/Dockerfile files is designed for Docker Compose integration, though you'll need to create your own docker-compose.yml or reference Kaneo's documentation for the official configuration. The individual Dockerfiles contain all necessary build instructions for service orchestration.

What base image does Kaneo's Dockerfile.kaneo provide?

According to the source code, Dockerfile.kaneo at the repository root serves as a foundational layer for custom multi-service builds. It can be extended when you need shared dependencies or tooling across Kaneo services, or when building custom variants of the platform.

Can I use the Kaneo Dockerfile for the web app in development mode?

The apps/web/Dockerfile is optimized for production static builds. For development with hot module replacement, you should mount source volumes and override the default command. The Dockerfile structure supports this through multi-stage builds where the development dependencies remain available in intermediate layers.

How do environment variables work across Kaneo's Dockerfiles?

Environment configuration is service-specific in Kaneo's containerization approach. The API Dockerfile accepts runtime variables for database connections and secrets, while the web Dockerfile typically bakes public configuration into the static build at compile time. Use .env files or orchestration-level secrets management for sensitive values.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →