Skip to content

[Feature] Docker Compose deployment support #10

Description

@lechan775

Description

添加 Docker 部署支持,方便一键启动。

Deliverables

├── Dockerfile                 # Spring Boot 镜像
├── docker-compose.yml         # MySQL + Backend
└── .env.example              # 环境变量模板

docker-compose.yml 示例

services:
  mysql:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
      MYSQL_DATABASE: words_demo
    volumes:
      - ./demo_backend/src/main/resources/db:/docker-entrypoint-initdb.d

  backend:
    build: ./demo_backend
    ports:
      - "8080:8080"
    depends_on:
      - mysql
    environment:
      SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/words_demo
      SPRING_DATASOURCE_USERNAME: root
      SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions