- Spring Boot 后端服务 (hss-home-service) - delivery-miniapp 配送小程序 - website 官网 (Nuxt) - docs 架构设计文档 - Docker 容器化部署配置 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
71 lines
1.5 KiB
YAML
71 lines
1.5 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: hss-postgres
|
|
environment:
|
|
POSTGRES_DB: hss_home_service
|
|
POSTGRES_USER: hss
|
|
POSTGRES_PASSWORD: hss123
|
|
ports:
|
|
- "5433:5432"
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U hss -d hss_home_service"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: hss-redis
|
|
ports:
|
|
- "6380:6379"
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redisdata:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: hss-app
|
|
ports:
|
|
- "18080:8080"
|
|
environment:
|
|
SPRING_PROFILES_ACTIVE: docker
|
|
DB_URL: jdbc:postgresql://postgres:5432/hss_home_service
|
|
DB_USERNAME: hss
|
|
DB_PASSWORD: hss123
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: "6379"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
website:
|
|
image: nginx:alpine
|
|
container_name: hss-website
|
|
ports:
|
|
- "3080:80"
|
|
volumes:
|
|
- ./website/.output/public:/usr/share/nginx/html:ro
|
|
- ./website/nginx-site.conf:/etc/nginx/conf.d/default.conf:ro
|
|
depends_on:
|
|
- app
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|
|
redisdata:
|