version: "3.9"

services:
  caddy:
    image: caddy:2-alpine
    container_name: caddy-rp
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    environment:
      TZ: "Asia/Shanghai"  # 设置时区为上海时区
    volumes:
      # 主配置
      - /docker/caddy/volume/config/Caddyfile:/etc/caddy/Caddyfile
      # 子配置目录
      - /docker/caddy/volume/config/caddy.d:/etc/caddy/sites-enabled
      # 站点文件目录
      - /docker/caddy/volume/html:/usr/share/caddy
      #  证书持久化
      - /docker/caddy/volume/caddy_data:/data
      - /docker/caddy/volume/caddy_config:/config


  mybiji:
    image: biji-houdaun:0.0.1-SNAPSHOT
    container_name: mybiji
    restart: unless-stopped
    ports:
      - "8084:8084"
    environment:
      TZ: "Asia/Shanghai"  # 设置时区为上海时区
      # 从环境变量传入数据库配置
      SPRING_DATASOURCE_URL: ${DB_URL}
      SPRING_DATASOURCE_USERNAME: ${DB_USERNAME}
      SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD}
      SPRING_PROFILES_ACTIVE: prod
    env_file:
      - .env  # 从.env文件读取环境变量
    #上面的若是配置mysql，就用，下面的sqlite文件，不用sqlite可以不用写
    volumes:
      - /docker/biji-houduan/data:/data
