version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: sim-link-server
    ports:
      - "8080:8080"
    volumes:
      # Mount results explicitly to view simulation outcomes and process new files.
      - ./results:/app/results
      # Mount the DB directory to retain data. Because our Docker WORKDIR is /app/server, 
      # the sim-link.db will be saved in /app/server/sim-link.db, matching this volume mapping.
      - ./server:/app/server
    restart: unless-stopped
    environment:
      - PORT=8080
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
