| # DS2API 开发环境配置 | |
| # 特性: | |
| # - 源代码挂载(热重载) | |
| # - 调试日志级别 | |
| # - 自动重启 | |
| # | |
| # 使用说明: | |
| # docker-compose -f docker-compose.dev.yml up | |
| services: | |
| ds2api: | |
| build: | |
| context: . | |
| target: go-builder | |
| image: ds2api:dev | |
| container_name: ds2api-dev | |
| command: ["go", "run", "./cmd/ds2api"] | |
| ports: | |
| # Host port is configurable via DS2API_HOST_PORT; container port stays fixed at 5001. | |
| - "${DS2API_HOST_PORT:-6011}:5001" | |
| env_file: | |
| - .env | |
| environment: | |
| - HOST=0.0.0.0 | |
| - LOG_LEVEL=DEBUG | |
| volumes: | |
| # 源代码挂载(开发时实时生效) | |
| - ./:/app | |
| # 配置文件挂载(便于本地修改) | |
| - ./config.json:/app/config.json | |
| restart: "no" | |
| stdin_open: true | |
| tty: true | |