File size: 815 Bytes
8d3471e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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