Files
distribution_erp/docker-compose.prod.yml
T
chpark 1181940bb8
Deploy momo-erp / deploy (push) Failing after 14m33s
infra: 운영 서버를 121.156.99.3 으로 이관 — SSH/DB host-internal 통합
- .gitea/workflows/deploy.yml: SSH 대상 121.156.99.3, sshpass 갱신
  + .env.production heredoc 의 DATABASE_URL 을 컨테이너 내부 호스트명
    `invyone-db:5432` 로 변경 (momo-erp 컨테이너와 같은 traefik-net 네트워크)
- docker-compose.prod.yml / README.md / CICD_SETUP.md: 서버 IP 일괄 갱신
- 부속 정리: stale 한 운영 문서 xlsx 들 제거 (실제 운영과 무관, working tree 정돈)

이제 main push 시 새 IDC 서버로 자동배포되며, DB 연결은 같은 호스트 내
컨테이너 네트워크로 직결 (외부 5432 우회 안 함).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 14:17:59 +09:00

42 lines
1.6 KiB
YAML

# 운영 배포 (Traefik + momotogether.com)
# 대상 서버: 121.156.99.3 (Traefik v2.11 외부 네트워크 traefik-net 사용)
# 사용: docker compose -f docker-compose.prod.yml up -d --build
services:
momo-erp:
build:
context: .
dockerfile: Dockerfile
image: momo-erp:latest
container_name: momo-erp
restart: always
env_file:
- .env.production
volumes:
# 업로드 이미지 영구 저장 — named volume 사용
# (호스트 바인드 마운트 시 root 소유로 자동 생성되어 nextjs uid 1001 의 mkdir 권한 부족.
# named volume 은 이미지의 /data_storage 디렉토리(Dockerfile 에서 chown nextjs:nodejs)를
# 볼륨 초기화 시 그대로 복제하므로 권한 문제 없음.)
- momo_data_storage:/data_storage
# 자가 배포: webhook 이 호스트의 deploy.sh 를 실행하기 위함
- /var/run/docker.sock:/var/run/docker.sock
- ./scripts/deploy.sh:/deploy/deploy.sh:ro
# source 디렉토리를 컨테이너 안에서 git pull 하기 위해 호스트의 소스를 마운트
- $PWD:/deploy/source
networks:
- traefik-net
labels:
- traefik.enable=true
- traefik.docker.network=traefik-net
- traefik.http.routers.momo-erp.rule=Host(`momotogether.com`) || Host(`www.momotogether.com`)
- traefik.http.routers.momo-erp.entrypoints=websecure,web
- traefik.http.routers.momo-erp.tls=true
- traefik.http.routers.momo-erp.tls.certresolver=le
- traefik.http.services.momo-erp.loadbalancer.server.port=3000
networks:
traefik-net:
external: true
volumes:
momo_data_storage: