83 lines
2.1 KiB
YAML
83 lines
2.1 KiB
YAML
# =============================================================================
|
|
# RDC Simulation - Docker Compose (GPU-enabled)
|
|
# =============================================================================
|
|
# Runs the simulation with GPU acceleration and X11 display forwarding.
|
|
#
|
|
# Usage:
|
|
# # Build the container
|
|
# docker compose build
|
|
#
|
|
# # Run interactive shell
|
|
# docker compose run --rm simulation
|
|
#
|
|
# # Run specific command
|
|
# docker compose run --rm simulation ./scripts/run_ardupilot_sim.sh runway
|
|
# =============================================================================
|
|
|
|
services:
|
|
simulation:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: rdc-simulation:latest
|
|
container_name: rdc-sim
|
|
|
|
# GPU support (NVIDIA)
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: all
|
|
capabilities: [gpu]
|
|
|
|
# Display forwarding for Gazebo GUI
|
|
environment:
|
|
- DISPLAY=${DISPLAY:-:0}
|
|
- NVIDIA_VISIBLE_DEVICES=all
|
|
- NVIDIA_DRIVER_CAPABILITIES=all
|
|
- QT_X11_NO_MITSHM=1
|
|
|
|
# Mount X11 socket for display
|
|
volumes:
|
|
- /tmp/.X11-unix:/tmp/.X11-unix:rw
|
|
- ~/.Xauthority:/home/pilot/.Xauthority:ro
|
|
|
|
# Network mode for SITL communication
|
|
network_mode: host
|
|
|
|
# Keep stdin open for interactive use
|
|
stdin_open: true
|
|
tty: true
|
|
|
|
# Run as current user (optional - for file permission compatibility)
|
|
# user: "${UID:-1000}:${GID:-1000}"
|
|
|
|
working_dir: /home/pilot/RDC_Simulation
|
|
|
|
# Alternative: Run headless (no display, for CI/testing)
|
|
simulation-headless:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: rdc-simulation:latest
|
|
container_name: rdc-sim-headless
|
|
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: all
|
|
capabilities: [gpu]
|
|
|
|
environment:
|
|
- NVIDIA_VISIBLE_DEVICES=all
|
|
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
|
- HEADLESS=1
|
|
|
|
network_mode: host
|
|
stdin_open: true
|
|
tty: true
|
|
working_dir: /home/pilot/RDC_Simulation
|