Files
myhome-server/docker-compose.mac-mini.yml
Hyungi Ahn 4b77086bb2 초기 홈 관리 시스템 API 구현
- Express.js 기반 백엔드 API 서버
- MariaDB, Redis, phpMyAdmin Docker 환경
- Device 관리 기본 CRUD 구현
- Mac Mini M4 Pro 전용 설정 및 배포 스크립트
- 자동화된 설치 및 배포 시스템
- 완전한 문서화 및 실행 가이드
2025-07-30 14:12:09 +09:00

116 lines
2.7 KiB
YAML

version: '3.8'
services:
mariadb:
image: mariadb:11-jammy
container_name: home_mariadb
environment:
MYSQL_ROOT_PASSWORD: mac_mini_root_password
MYSQL_DATABASE: home_management
MYSQL_USER: homeuser
MYSQL_PASSWORD: mac_mini_home_password
ports:
- "3306:3306"
volumes:
- mariadb_data:/var/lib/mysql
- ./scripts/setup-db.sql:/docker-entrypoint-initdb.d/setup.sql
- ./config/mariadb.cnf:/etc/mysql/conf.d/custom.cnf
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
--innodb-buffer-pool-size=4G
--innodb-log-file-size=512M
--max-connections=200
--query-cache-size=256M
restart: unless-stopped
networks:
- home_network
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: home_phpmyadmin
environment:
PMA_HOST: mariadb
PMA_PORT: 3306
PMA_USER: homeuser
PMA_PASSWORD: mac_mini_home_password
UPLOAD_LIMIT: 2G
MEMORY_LIMIT: 512M
ports:
- "8080:80"
depends_on:
- mariadb
restart: unless-stopped
networks:
- home_network
redis:
image: redis:7-alpine
container_name: home_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
- ./config/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
restart: unless-stopped
networks:
- home_network
api:
build: .
container_name: home_api
environment:
NODE_ENV: production
DB_HOST: mariadb
DB_PORT: 3306
DB_NAME: home_management
DB_USER: homeuser
DB_PASSWORD: mac_mini_home_password
REDIS_HOST: redis
REDIS_PORT: 6379
JWT_SECRET: mac-mini-production-jwt-secret-key-2025
API_PORT: 3000
API_HOST: 0.0.0.0
CORS_ORIGIN: http://mac-mini-m4.local:3001,http://localhost:3001,http://192.168.1.100:3001
LOG_LEVEL: info
BCRYPT_ROUNDS: 12
ports:
- "3000:3000"
volumes:
- ./logs:/app/logs
- ./uploads:/app/uploads
- /Users/hyungi/home-management-data:/app/data
depends_on:
- mariadb
- redis
restart: unless-stopped
networks:
- home_network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
mariadb_data:
driver: local
driver_opts:
type: none
o: bind
device: /Users/hyungi/home-management-db
redis_data:
driver: local
driver_opts:
type: none
o: bind
device: /Users/hyungi/home-management-redis
networks:
home_network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16