Skip to content

Latest commit

 

History

History
80 lines (57 loc) · 2.15 KB

File metadata and controls

80 lines (57 loc) · 2.15 KB

Docker Setup for tree-view-cli

This document explains how to use Docker with the tree-view-cli project, including both development and production workflows.

Development Workflow

The Docker environment is configured for optimal development experience with:

  • Fast dependency installation using uv
  • Efficient layer caching for quick rebuilds
  • Volume mounts for live code editing
  • Separate services for testing and coverage viewing

Starting the Development Environment

Build and start the development environment:

If you enviroment has Make

make up

Or

docker compose up --build

This will:

  1. Build the Docker image with your application
  2. Start two services:

For teardown the containers

make down

Or

docker compose down --remove-orphans  --rmi local --volumes

Working with the Environment

  • Edit code locally, and changes will be reflected immediately in the container
  • Test results and coverage reports are stored in a persistent Docker volume
  • Resource limits prevent the container from consuming excessive resources

Production Deployment

For production deployment, the Dockerfile is optimized for security and efficiency:

  • Uses the official astral-sh/uv Python image
  • Implements proper dependency caching
  • Runs as a non-root user for enhanced security
  • Includes bytecode compilation for better performance
  • Minimizes image size through optimal layer management

Building for Production

Build the production image:

docker build -t tree-view-cli .

If deploying to a different architecture (e.g., from Apple Silicon to x86):

docker build --platform=linux/amd64 -t tree-view-cli .

References