Project

General

Profile

NVidia GPU 연동 » docker-compose.yml

상혁 손, 2025-10-11 21:29

 
version: '3.8'
services:
base-server:
build:
context: .
dockerfile: Containerfile
container_name: bigdata_server
restart: unless-stopped
network_mode: "host"


# podman-compose에서 동작하는 예시 방식
devices:
- "nvidia.com/gpu=all"

labels:
- "run.oci.runtime.podman.devices=all"

security_opt:
- label=disable # 또는 SELinux 사용시 제거하고 :Z 사용
- seccomp=unconfined

environment:
- NVIDIA_VISIBLE_DEVICES=all
- TZ=Asia/Seoul
- DB_HOST=localhost
- DB_PORT=15433
- DB_USER=spacs
- DB_PASSWORD=scaps
- DB_NAME=spacs

volumes:
- ./ssdoctors:/home/ssdoctors # (아래 node_modules 처리 참고)
- ./data/workspace:/workspace


# 2. PostgreSQL 서비스 (Bigdata용)
postgres:
build:
context: .
dockerfile: postgres.Containerfile
container_name: bigdata_postgresql # <<< 변경: 컨테이너 이름 변경
restart: unless-stopped
#pull_policy: always
#user: '70:70'
init: true
privileged: true
network_mode: "host"
ports:
- "15433:5432"
command: postgres -c port=15433 -c shared_preload_libraries=pg_cron -c cron.database_name=spacs
environment:
- TZ=Asia/Seoul
- POSTGRES_USER=spacs
- POSTGRES_PASSWORD=scaps
- POSTGRES_DB=spacs
- PGPORT=15433
volumes:
- ./data/postgresql:/var/lib/postgresql/data:Z
security_opt:
- label=disable
- seccomp=unconfined
#healthcheck:
# test: ["CMD-SHELL", "pg_isready -U spacs -d spacs -p 15433"]
# interval: 10s
# timeout: 5s
# retries: 5


volumes:
# (필요시 node_modules용 named volume 추가 – 아래 참고)

(2-2/2)