- Express.js 기반 백엔드 API 서버 - MariaDB, Redis, phpMyAdmin Docker 환경 - Device 관리 기본 CRUD 구현 - Mac Mini M4 Pro 전용 설정 및 배포 스크립트 - 자동화된 설치 및 배포 시스템 - 완전한 문서화 및 실행 가이드
94 lines
2.1 KiB
YAML
94 lines
2.1 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
mariadb:
|
|
image: mariadb:11-jammy
|
|
container_name: home_mariadb
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: root_password
|
|
MYSQL_DATABASE: home_management
|
|
MYSQL_USER: homeuser
|
|
MYSQL_PASSWORD: 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=2G
|
|
--innodb-log-file-size=256M
|
|
--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: 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: home_password
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: 6379
|
|
JWT_SECRET: mac-mini-jwt-secret-key
|
|
API_PORT: 3000
|
|
API_HOST: 0.0.0.0
|
|
CORS_ORIGIN: http://mac-mini-m4:3001,http://localhost:3001
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
- ./uploads:/app/uploads
|
|
depends_on:
|
|
- mariadb
|
|
- redis
|
|
restart: unless-stopped
|
|
networks:
|
|
- home_network
|
|
|
|
volumes:
|
|
mariadb_data:
|
|
redis_data:
|
|
|
|
networks:
|
|
home_network:
|
|
driver: bridge |