pi_pico/color_switcher/docker-compose.yml
Mohamed Salem 66e18ed248 Extract reusable components into git submodules
STD_TYPES, MCU_UART, MCU_USB, MCU_PIO, HAL_COM, HAL_LED moved to
separate repos under common/ as git submodules. Each submodule ships
with default config (cfg/) that projects can override.

color_switcher/src/ now contains only project-specific components
(APP_CLSW, SYS_ECU). CMake sources_config references common/ via
COMMON_DIR. Docker volume mounts ../common:/common so the container
sees the submodules. Build verified — zero errors.
2026-04-13 03:55:25 +02:00

40 lines
2.1 KiB
YAML

# ============================================================================
# Docker Compose configuration for the Raspberry Pi Pico firmware project
# ============================================================================
# The container is configured to be long-running (sleep infinity) rather than
# running the build on startup. This lets the same container be used for:
# 1. One-shot builds from the host
# 2. Interactive shells (docker compose exec) for debugging
# 3. VS Code Dev Containers - which expects the container to stay alive
# so it can attach clangd, install extensions, and open a terminal
#
# Usage:
# docker compose build - (re)build the image after Dockerfile changes
# docker compose up -d - start the persistent container in the background
# docker compose exec pico-build bash - shell into the running container
# docker compose run --rm pico-build bash build.sh - one-shot firmware build, container removed after
# docker compose down - stop and remove the persistent container
# ============================================================================
services:
pico-build:
# Build the image from the Dockerfile in the project root
build: .
# Mount project source and the shared common components into the container.
# The project mounts at /project (working directory). The common submodules
# mount at /common so the CMake COMMON_DIR path (../common relative to the
# project root) resolves correctly inside the container.
volumes:
- .:/project
- ../common:/common
# Keep the container alive indefinitely. We intentionally do NOT run the
# build on startup - `sleep infinity` lets the container stay up so it can
# be used as a persistent dev environment (VS Code Dev Containers, shells
# via `docker compose exec`, etc.). To trigger a build, run:
# docker compose run --rm pico-build bash build.sh
# or, if you're already inside the container:
# bash build.sh
command: sleep infinity