feat: 모델 및 데이터베이스 구조 개선
- 모델 파일들의 데이터베이스 연결 및 쿼리 최적화 - 마이그레이션 파일 정리 및 통합 - Docker 설정 파일 추가 - 프로젝트 시작/중지 스크립트 추가 - README 및 문서 업데이트
This commit is contained in:
116
docker-compose.yml
Normal file
116
docker-compose.yml
Normal file
@@ -0,0 +1,116 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
# MariaDB 데이터베이스
|
||||
db:
|
||||
image: mariadb:10.9
|
||||
container_name: fb_db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=hyungi_root_password_2025
|
||||
- MYSQL_DATABASE=hyungi
|
||||
- MYSQL_USER=hyungi
|
||||
- MYSQL_PASSWORD=hyungi_password_2025
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
- ./api.hyungi.net/migrations:/docker-entrypoint-initdb.d
|
||||
ports:
|
||||
- "20306:3306"
|
||||
networks:
|
||||
- fb_network
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
||||
timeout: 20s
|
||||
retries: 10
|
||||
|
||||
# API 서버 (Node.js)
|
||||
api:
|
||||
build:
|
||||
context: ./api.hyungi.net
|
||||
dockerfile: Dockerfile
|
||||
container_name: fb_api
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "20005:20005"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DB_HOST=db
|
||||
- DB_NAME=hyungi
|
||||
- DB_USER=hyungi
|
||||
- DB_PASSWORD=hyungi_password_2025
|
||||
- DB_ROOT_PASSWORD=hyungi_root_password_2025
|
||||
volumes:
|
||||
- ./api.hyungi.net/public/img:/usr/src/app/public/img:ro
|
||||
- ./api.hyungi.net/uploads:/usr/src/app/uploads
|
||||
- ./api.hyungi.net/logs:/usr/src/app/logs
|
||||
networks:
|
||||
- fb_network
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
# 웹 UI (Nginx)
|
||||
web-ui:
|
||||
build:
|
||||
context: ./web-ui
|
||||
dockerfile: Dockerfile
|
||||
container_name: fb_web_ui
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "20000:80"
|
||||
volumes:
|
||||
- ./web-ui:/usr/share/nginx/html:ro
|
||||
networks:
|
||||
- fb_network
|
||||
depends_on:
|
||||
- api
|
||||
|
||||
# FastAPI 브릿지
|
||||
fastapi-bridge:
|
||||
build:
|
||||
context: ./fastapi-bridge
|
||||
dockerfile: Dockerfile
|
||||
container_name: fb_fastapi_bridge
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "20010:8000"
|
||||
environment:
|
||||
- EXPRESS_API_URL=http://api:20005
|
||||
- NODE_ENV=production
|
||||
networks:
|
||||
- fb_network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
# phpMyAdmin (DB 관리도구)
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin:latest
|
||||
container_name: fb_phpmyadmin
|
||||
depends_on:
|
||||
- db
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "20080:80"
|
||||
environment:
|
||||
- PMA_HOST=db
|
||||
- PMA_USER=root
|
||||
- PMA_PASSWORD=hyungi_root_password_2025
|
||||
- UPLOAD_LIMIT=50M
|
||||
networks:
|
||||
- fb_network
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
fb_network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user