services:
  # openssh
  openssh:
    image: linuxserver/openssh-server:latest
    container_name: openssh
    profiles:
      - openssh
    depends_on:
      - caddy
    restart: on-failure:5
    env_file:
      - ./env/openssh.env
    environment:
      - PUID=${PUID:-1000}
      - PGID=${PGID:-1000}
    volumes:
      - openssh_config:/config:rw
      - ./config/authorized_keys:/authorized_ssh_keys:ro
      - public_data:/public:rw
      - private_data:/private:rw
      - caddy_data:/caddy_data:rw
      - caddy_config:/caddy_config:rw
      - caddy_backup:/caddy_backup:rw
      - 7daystodie_backup:/7daystodie_backup:rw
      - 7daystodie_server_save:/7daystodie_server_save:rw
      - 7daystodie_server_config_lgsm:/7daystodie_server_config_lgsm:rw
      - 7daystodie_server_file:/7daystodie_server_file:rw
      - 7daystodie_server_log:/7daystodie_server_log:rw
      - satisfactory_backup:/satisfactory_backup:rw
      - satisfactory_server_config:/satisfactory_server_config:rw
      - minecraft_server_backup:/minecraft_server_backup:rw
      - minecraft_server_data:/minecraft_server_data:rw
      - minecraft_proxy_data:/minecraft_proxy_data:rw
      - minecraft_rcon_data:/minecraft_rcon_data:rw

    networks:
      - infra-network
    security_opt:
      - no-new-privileges:false
    ports:
      - 2222:2222
volumes:
  openssh_config:
    name: openssh_config
  public_data:
    name: public_data
  private_data:
    name: private_data
  caddy_data:
    name: caddy_data
  caddy_config:
    name: caddy_config
  caddy_backup:
    name: caddy_backup
# 7daystodie-server
  7daystodie_backup:
    name: 7daystodie_backup
  7daystodie_server_save:
    name: 7daystodie_server_save
  7daystodie_server_config_lgsm:
    name: 7daystodie_server_config_lgsm
  7daystodie_server_file:
    name: 7daystodie_server_file
  7daystodie_server_log:
    name: 7daystodie_server_log
# satisfactory-server
  satisfactory_backup:
    name: satisfactory_backup
  satisfactory_server_config:
    name: satisfactory_server_config
# minecraft-server
  minecraft_server_backup:
    name: minecraft_server_backup
  minecraft_server_data:
    name: minecraft_server_data
  minecraft_proxy_data:
    name: minecraft_proxy_data
  minecraft_rcon_data:
    name: minecraft_rcon_data
