mirror of
https://github.com/euzu/tuliprox.git
synced 2026-09-17 14:42:11 +02:00
This commit introduces a new 'debug' build stage in the Dockerfile to facilitate remote debugging for development environments. It also includes a general reformatting of the Dockerfile for better readability and maintainability.
71 lines
2.4 KiB
YAML
71 lines
2.4 KiB
YAML
# ===================================================================
|
|
# DOCKER COMPOSE OVERRIDE - DEVELOPMENT & DEBUGGING
|
|
#
|
|
# How this overwrite file works with docker-compose.yml:
|
|
#
|
|
# - Dictionaries/Mappings (like 'environment', 'labels'):
|
|
# Keys are ADDED or OVERWRITTEN.
|
|
#
|
|
# - Lists/Arrays (like 'ports', 'volumes' mounts):
|
|
# The ENTIRE list is REPLACED. You must re-state all items.
|
|
#
|
|
# - Single values (like 'image', 'user', 'build'):
|
|
# The value is REPLACED.
|
|
# ===================================================================
|
|
version: '3.8'
|
|
|
|
# Define named volumes that will persist on the host machine
|
|
volumes:
|
|
cargo_cache:
|
|
cargo_registry:
|
|
|
|
services:
|
|
gluetun_vpn_1:
|
|
ports:
|
|
- "1080:1080"
|
|
- "8901:8901"
|
|
# Add debugging server for VSCode
|
|
- "10586:10586" # LLDB-Server (main control port)
|
|
- "10600-10700:10600-10700" # LLDB-Server (range for the debug sessions)
|
|
|
|
tuliprox:
|
|
# Override the build configuration to use the 'debug' stage
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile
|
|
target: debug
|
|
args:
|
|
# Use the 'musl' target for the Alpine-based debug image
|
|
RUST_TARGET: x86_64-unknown-linux-musl
|
|
# # Use the 'gnu' target for the Debian-based debug image
|
|
# RUST_TARGET: x86_64-unknown-linux-gnu
|
|
# ports:
|
|
# - "8901:8901"
|
|
# # Add debugging server for VSCode
|
|
# - "10586:10586" # LLDB-Server (main control port)
|
|
# - "10600-10700:10600-10700" # LLDB-Server (range for the debug sessions)
|
|
environment:
|
|
# Pass port configuration to the entrypoint script
|
|
- LLDB_SERVER_PORT=10586
|
|
- LLDB_MIN_PORT=10600
|
|
- LLDB_MAX_PORT=10700
|
|
|
|
# Must be set to allow process debugging
|
|
privileged: true
|
|
|
|
# Run as root to avoid permission issues with the lldb debugger
|
|
user: "root"
|
|
|
|
# Mount the persistent volumes into the container at the locations
|
|
# Cargo uses for caching. This is the key to fast, incremental builds.
|
|
volumes:
|
|
# Default tuliprox mounts
|
|
- "./config:/app/config:rw"
|
|
- "./data:/app/data:rw"
|
|
- "./backup:/app/backup:rw"
|
|
- "./downloads:/app/downloads:rw"
|
|
# Mounts the project's build artifacts cache
|
|
- cargo_cache:/usr/src/tuliprox/target
|
|
# Mounts the cache for downloaded crate dependencies
|
|
- cargo_registry:/usr/local/cargo/registry
|