services:
  gomft:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        # Set the UID/GID to match your host user for better file permissions
        # Default is 1000:1000 if not specified
        UID: ${UID:-1000}
        GID: ${GID:-1000}
        # Version information
        VERSION: ${VERSION:-dev}
        BUILD_TIME: ${BUILD_TIME:-unknown}
        COMMIT: ${COMMIT:-unknown}
    container_name: gomft
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      # Main data directory - contains DB and configs
      - gomft-data:/app/data
      # Separate backups directory
      - gomft-backups:/app/backups
      # For development, you can mount the source code
      # - .:/app
    environment:
      - TZ=UTC
      - DATA_DIR=/app/data
      - BACKUP_DIR=/app/backups
      - LOGS_DIR=/app/data/logs
      # - LOG_LEVEL=info
    networks:
      - gomft-network
    # For non-root installs, the container needs to run with the same UID
    # as the host user to access mounted volumes properly
    user: ${UID:-1000}:${GID:-1000}

networks:
  gomft-network:
    driver: bridge

volumes:
  gomft-data:
    driver: local
  gomft-backups:
    driver: local 