AssetPilot OrangePi 5 Pluse Server-First Commit
This commit is contained in:
67
asset_pilot_docker/docker-compose.yml
Normal file
67
asset_pilot_docker/docker-compose.yml
Normal file
@@ -0,0 +1,67 @@
|
||||
services:
|
||||
# 1. PostgreSQL 데이터베이스
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: asset_pilot_db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: asset_pilot
|
||||
POSTGRES_USER: asset_user
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:-assetpilot}
|
||||
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --locale=C"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./init-db:/docker-entrypoint-initdb.d
|
||||
ports:
|
||||
- "5432:5432"
|
||||
networks:
|
||||
- asset_pilot_network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U asset_user -d asset_pilot"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# 2. Asset Pilot 웹 애플리케이션
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
# DNS 설정 (빌드 밖으로 이동)
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 1.1.1.1
|
||||
container_name: asset_pilot_app
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
# DB 비밀번호 기본값을 postgres 서비스와 동일하게 'assetpilot'으로 설정
|
||||
DATABASE_URL: postgresql://asset_user:${DB_PASSWORD:-assetpilot}@postgres:5432/asset_pilot
|
||||
APP_HOST: 0.0.0.0
|
||||
APP_PORT: 8000
|
||||
DEBUG: "False"
|
||||
FETCH_INTERVAL: 5
|
||||
ports:
|
||||
- "8000:8000"
|
||||
networks:
|
||||
- asset_pilot_network
|
||||
volumes:
|
||||
- app_logs:/app/logs
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
app_logs:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
asset_pilot_network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user