version: '3'

services:
  os:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: docker_3dp
    ports:
      - "80:80" #NGINX NEXTCLOUD
      - "2212:22"  # SSH
      - "3000:3000" #FLASK API
      - "3306:3306" # DB
      - "8080:8080"  # EMBED TOMCAT
      - "8090:8090"  # EMBED TOMCAT(g3d)
      - "8060:8060" # EMBED TOMCAT(rvoch3d)
      - "8071:8071" # EMBED TOMCAT(g3d-test)
    network_mode: bridge
    restart: always
    volumes:
      - ./printer:/home/gds/printer
      - ./data:/data
      - ./sites-available:/etc/nginx/sites-available
      - 3dp_dbconfig:/etc/mysql
      - 3dp_dbdata:/var/lib/mysql
      - /dev/fuse:/dev/fuse #App image 사용을 위한 device mount
    devices:
      - /dev/fuse #FUSE 디바이스 사용
    cap_add:
      - SYS_ADMIN #시스템 관리자 권한 추가
    security_opt:
      - apparmor:unconfined #AppArmor 비활성화
volumes:
    3dp_dbconfig:
        external: true
    3dp_dbdata:
        external: true    
