Files
teapot_system/docker-compose.yml
2026-04-12 19:04:31 +08:00

28 lines
836 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3.8'
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: teapot_backend
restart: always
environment:
# 指定SQLite数据库文件挂载到/app/data中防止容器重启丢失数据
- SPRING_DATASOURCE_URL=jdbc:sqlite:/app/data/teapot-system.db
# NAS服务器的关键确保商品图片或数据库不随容器重启销毁
volumes:
- ./data:/app/data
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: teapot_frontend
restart: always
depends_on:
- backend
ports:
# 选择避开了NAS常见的80, 443, 3000, 8080等端口用 8090 作为外部访问端。
# 你可以在NAS路由器或面板中直接访问: http://群晖NAS_IP:8090
- "8090:8090"