version: '3.8'
services:
  jupyter:
    shm_size: "2g"
    build:
      context: .
      dockerfile: Dockerfile
    container_name: jupyter-gpu
    ports:
      - "8888:8888"
    restart: always
    volumes:
      - ./workspace:/workspace
    environment:
      - NVIDIA_VISIBLE_DEVICES=all  # 모든 GPU를 사용하려면 이렇게 설정
      - TF_FORCE_GPU_ALLOW_GROWTH=true
      - LD_LIBRARY_PATH=/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/lib/x86_64-linux-gnu
      - CUDA_HOME=/usr/local/cuda
      - XLA_FLAGS=--xla_gpu_cuda_data_dir=/usr/local/cuda
      - TF_XLA_FLAGS=--tf_xla_enable_xla_devices=false
    runtime: nvidia  # GPU 자원을 사용하기 위한 설정 
