109 lines
2.8 KiB
YAML
109 lines
2.8 KiB
YAML
name: ljwx-platform-stack
|
|
|
|
services:
|
|
postgres:
|
|
image: ${POSTGRES_IMAGE:-postgres:16-alpine}
|
|
container_name: ljwx-platform-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: ${DB_NAME:-ljwx_platform}
|
|
POSTGRES_USER: ${DB_USERNAME:-postgres}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
|
|
expose:
|
|
- "5432"
|
|
volumes:
|
|
- ljwx_platform_pg:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"pg_isready -U ${DB_USERNAME:-postgres} -d ${DB_NAME:-ljwx_platform}",
|
|
]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
|
|
redis:
|
|
image: ${REDIS_IMAGE:-redis:7-alpine}
|
|
container_name: ljwx-platform-redis
|
|
restart: unless-stopped
|
|
expose:
|
|
- "6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: ljwx-platform-app/Dockerfile
|
|
image: ${BACKEND_IMAGE:-ljwx-platform-app:local}
|
|
container_name: ljwx-platform-backend
|
|
restart: unless-stopped
|
|
environment:
|
|
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-dev}
|
|
DB_HOST: postgres
|
|
DB_PORT: 5432
|
|
DB_NAME: ${DB_NAME:-ljwx_platform}
|
|
DB_USERNAME: ${DB_USERNAME:-postgres}
|
|
DB_PASSWORD: ${DB_PASSWORD:-postgres}
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: 6379
|
|
SERVER_PORT: 8080
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
ports:
|
|
- "${BACKEND_PORT:-18080}:8080"
|
|
|
|
admin:
|
|
build:
|
|
context: .
|
|
dockerfile: ljwx-platform-admin/Dockerfile
|
|
args:
|
|
VITE_APP_BASE_API: ${ADMIN_API_BASE:-/api}
|
|
VITE_APP_TITLE: ${ADMIN_APP_TITLE:-LJWX Platform Admin}
|
|
image: ${ADMIN_IMAGE:-ljwx-platform-admin:local}
|
|
container_name: ljwx-platform-admin
|
|
restart: unless-stopped
|
|
depends_on:
|
|
backend:
|
|
condition: service_started
|
|
volumes:
|
|
- ./deploy/compose/nginx/admin.conf:/etc/nginx/conf.d/default.conf:ro
|
|
ports:
|
|
- "${ADMIN_PORT:-18081}:80"
|
|
|
|
screen:
|
|
build:
|
|
context: .
|
|
dockerfile: ljwx-platform-screen/Dockerfile
|
|
args:
|
|
VITE_APP_BASE_API: ${SCREEN_API_BASE:-/api}
|
|
VITE_APP_TITLE: ${SCREEN_APP_TITLE:-LJWX Platform Screen}
|
|
image: ${SCREEN_IMAGE:-ljwx-platform-screen:local}
|
|
container_name: ljwx-platform-screen
|
|
restart: unless-stopped
|
|
depends_on:
|
|
backend:
|
|
condition: service_started
|
|
volumes:
|
|
- ./deploy/compose/nginx/screen.conf:/etc/nginx/conf.d/default.conf:ro
|
|
ports:
|
|
- "${SCREEN_PORT:-18082}:80"
|
|
|
|
volumes:
|
|
ljwx_platform_pg:
|
|
|
|
networks:
|
|
default:
|
|
name: ljwx-platform-stack-net
|
|
ipam:
|
|
driver: default
|
|
config:
|
|
- subnet: 10.89.0.0/24
|