- Add Docker Compose configuration for Maven + Java 21 development container - Include SSH server support for remote development (Zed editor compatible) - Install Bun package manager and opencode-ai for enhanced development workflow - Provide Makefile with commands for build, up, down, restart, logs, shell, ssh, and clean - Add .env.example template for configurable ports and paths - Include .gitignore for Java/Maven artifacts and IDE files - Configure USTC mirrors for faster package installation - Support persistent volume mounting for root user configuration (.ssh, .m2 cache)
18 lines
567 B
YAML
18 lines
567 B
YAML
services:
|
|
maven-dev-env:
|
|
image: maven-java21-dev:3.9-ssh
|
|
build:
|
|
context: .
|
|
dockerfile: Containerfile
|
|
container_name: maven-devcontainer
|
|
hostname: maven-devcontainer
|
|
restart: always
|
|
ports:
|
|
- "${APP_PORT:-9090}:9090"
|
|
- "${SSH_PORT:-2322}:22" # [新增] SSH 端口,宿主机通过 localhost:2222 连接
|
|
volumes:
|
|
- ${PROJECT_DIR:-/workspace}:/workspace
|
|
# 持久化 Root 用户配置(包含 .ssh, .m2 缓存, .config/zed 等)
|
|
- /workspace/devcontainer-vols/maven-devcontainer-root:/root
|
|
|