FlyingFish
FlyingFish on GitHub
  • FlyingFish
    • About the project
    • Screenshots
    • Installation
      • Quick Setup
      • Quick Update
      • Create Backup
      • Long setup
        • Env
        • Docker compose
          • Ports
          • Network
      • Storage management
      • FAQ
    • Configurations
      • Which user type am I
      • Listen
        • Port forwarding
        • Proxy protocol
        • IP Access
        • Gateway identifiers
        • UPnP Nat
      • Domains
        • DynDns Clients
        • Own DNS Server
        • Discussions Subdomains
        • DynDns Server
      • Routes
    • Examples
      • SSH hidden on HTTPS
      • FlyingFish to other reverse proxy
      • Backup Server, SSH to Nas
      • Own DynDNS Server - Fritzbox
      • Inventree - Route
    • Developer
      • Ideas, requests and bugs
      • Project structure
        • Under the hood
        • Service structure
        • Schema
        • Object name rules
      • Image build
      • Plugins
    • Contribution
Powered by GitBook
On this page
  • Parts container
  • Production template
Edit on GitHub
  1. FlyingFish
  2. Installation
  3. Long setup

Docker compose

PreviousEnvNextPorts

Last updated 3 months ago

The current docker compose file is maintained in the folder for productive use.

Please do not use the docker compose file from the main folder. As this is used for the development of FlyingFish.

Parts container

FlyingFish is divided into several services, thus into containers. The containers have different rights to the system.

Container
Description

flyingfish_db

Contains the MariaDB and is accessible for various containers from FlyingFish in Docker's own network.

flyingfish_influxdb

Contains the Influxdb and is accessible for various containers from FlyingFish in Docker's own network.

flyingfish_redis

CContains the Redis server, which enables memory event communication between the other containers.

flyingfish_service

Contains the Nginx and backend with frontend.

flyingfish_himhip

Contains the service for reading out the host IP and gateway. The task is limited because this container runs with special privileges. The information is sent to the FlyingFish backend.

flyingfish_ssh

A custom implemented SSH jump server that only accepts port forwarding with L and R.

flyingfish_ddns

This container takes care of requests from DynDns-Clients.

Production template

The compose file should be optimally prepared. For more customization, you can read more below.

GitHub under the "setup"
https://github.com/stefanwerfling/flyingfish/blob/main/setup/docker-compose.yml
services:
  mariadb:
    image: mariadb:lts
    container_name: flyingfish_db
    environment:
      MARIADB_AUTO_UPGRADE: '1'
      MARIADB_INITDB_SKIP_TZINFO: '1'
      MYSQL_ROOT_PASSWORD: "${MARIADB_ROOT_PASSWORD}"
      MYSQL_ROOT_HOST: '%'
      MYSQL_DATABASE: "${MARIADB_DATABASE}"
    healthcheck:
      test: [ "CMD", "mariadb", "-u${MARIADB_ROOT_USERNAME}", "-p${MARIADB_ROOT_PASSWORD}", "-e", "use ${MARIADB_DATABASE}" ]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 5s
    volumes:
      - flyingfishDbData:/var/lib/mysql
    ports:
      - "127.0.0.1:3306:3306"
    networks:
      flyingfishNet:
          ipv4_address: 10.103.0.2
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"

  influxdb:
    image: influxdb:latest
    container_name: flyingfish_influxdb
    volumes:
      - flyingfishInfluxdbData:/var/lib/influxdb2
    environment:
      - DOCKER_INFLUXDB_INIT_MODE=setup
      - DOCKER_INFLUXDB_INIT_USERNAME=${INFLUXDB_USERNAME}
      - DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUXDB_PASSWORD}
      - DOCKER_INFLUXDB_INIT_ORG=${INFLUXDB_ORG}
      - DOCKER_INFLUXDB_INIT_BUCKET=${INFLUXDB_BUCKET}
      - DOCKER_INFLUXDB_INIT_RETENTION=${INFLUXDB_RETENTION}
      - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUXDB_ADMIN_TOKEN}
      - INFLUXDB_STORAGE_CACHE_MAX_MEMORY_SIZE=52428800
      - INFLUXDB_STORAGE_CACHE_SNAPSHOT_MEMORY_SIZE=26214400
      - INFLUXDB_STORAGE_CACHE_SNAPSHOT_WRITE_COLD_DURATION=10s
      - INFLUXDB_STORAGE_WAL_FSYNC_DELAY=1s
      - INFLUXDB_STORAGE_INDEX_VERSION=tsi1
    ports:
      - "127.0.0.1:8086:8086"
    networks:
      flyingfishNet:
        ipv4_address: 10.103.0.5
    healthcheck:
      test: "curl -f http://localhost:8086/ping"
      interval: 5s
      timeout: 10s
      retries: 5
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"

  redis:
    image: redis:7.2-alpine
    container_name: flyingfish_redis
    volumes:
      - flyingfishRedisData:/data
    ports:
      - '127.0.0.1:6379:6379'
    command: [
      "redis-server",
      "--save",
      "${REDIS_SAVE}",
      "--loglevel",
      "${REDIS_LOGLEVEL}",
      "--maxmemory",
      "${REDIS_MAX_MEMORY}",
      "--maxmemory-policy",
      "allkeys-lru",
      "--requirepass",
      "${REDIS_REQUIREPASS}"
    ]
    networks:
      flyingfishNet:
        ipv4_address: 10.103.0.7
    healthcheck:
      test: [ "CMD-SHELL", "redis-cli -a ${REDIS_REQUIREPASS} ping | grep PONG" ]
      interval: 1s
      timeout: 3s
      retries: 5
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"

  flyingfish:
    image: stefanwerfling/flyingfish:latest
    container_name: flyingfish_service
    volumes:
      - flyingfishLetsencrypt:/etc/letsencrypt:rw
      - flyingfish:/var/lib/flyingfish:rw
    environment:
      FLYINGFISH_DB_MYSQL_USERNAME: "${MARIADB_ROOT_USERNAME}"
      FLYINGFISH_DB_MYSQL_PASSWORD: "${MARIADB_ROOT_PASSWORD}"
      FLYINGFISH_DB_MYSQL_DATABASE: "${MARIADB_DATABASE}"
      FLYINGFISH_DB_INFLUX_URL: "${INFLUXDB_URL}"
      FLYINGFISH_DB_INFLUX_TOKEN: "${INFLUXDB_ADMIN_TOKEN}"
      FLYINGFISH_DB_INFLUX_ORG: "${INFLUXDB_ORG}"
      FLYINGFISH_DB_INFLUX_BUCKET: "${INFLUXDB_BUCKET}"
      FLYINGFISH_HTTPSERVER_PORT: "${HTTPSERVER_PORT}"
      FLYINGFISH_LOGGING_LEVEL: "${LOGGING_LEVEL}"
      FLYINGFISH_HIMHIP_USE: "${HIMHIP_USE}"
      FLYINGFISH_HIMHIP_SECRET: "${HIMHIP_SECRET}"
      FLYINGFISH_DYNDNSSERVER_ENABLE: "${DYNDNSSERVER_ENABLE}"
      FLYINGFISH_DB_REDIS_URL: "${REDIS_URL}"
      FLYINGFISH_DB_REDIS_PASSWORD: "${REDIS_REQUIREPASS}"
    ports:
      - "443:443"
      - "80:80"
      - "5333:53/udp"
      - "5333:53/tcp"
      - "${HTTPSERVER_PORT}:${HTTPSERVER_PORT}"
      - "1900:1900"
    networks:
      flyingfishNet:
        ipv4_address: 10.103.0.3
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"
    depends_on:
      mariadb:
        condition: service_healthy
      redis:
        condition: service_healthy
      influxdb:
        condition: service_healthy

  himhip:
    image: stefanwerfling/flyingfish_himip:latest
    container_name: flyingfish_himhip
    environment:
      FLYINGFISH_SECRET: "${HIMHIP_SECRET}"
      FLYINGFISH_SERVER_PORT: "${HTTPSERVER_PORT}"
      FLYINGFISH_LOGGING_LEVEL: "${LOGGING_LEVEL}"
      FLYINGFISH_DB_REDIS_URL: "${REDIS_URL}"
      FLYINGFISH_DB_REDIS_PASSWORD: "${REDIS_REQUIREPASS}"
    network_mode: host
    cap_add:
      - ALL
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"
    depends_on:
      redis:
        condition: service_healthy
      flyingfish:
        condition: service_started

  sshremote:
    image: stefanwerfling/flyingfish_ssh:latest
    container_name: flyingfish_ssh
    volumes:
      - flyingfishSsh:/opt/app/ssh:rw
    environment:
      FLYINGFISH_DB_MYSQL_USERNAME: "${MARIADB_ROOT_USERNAME}"
      FLYINGFISH_DB_MYSQL_PASSWORD: "${MARIADB_ROOT_PASSWORD}"
      FLYINGFISH_DB_MYSQL_DATABASE: "${MARIADB_DATABASE}"
      FLYINGFISH_HTTPSERVER_PORT: "${HTTPSERVER_PORT}"
      FLYINGFISH_LOGGING_LEVEL: "${LOGGING_LEVEL}"
    ports:
      - "2222:22"
    networks:
      flyingfishNet:
        ipv4_address: 10.103.0.4
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"
    depends_on:
      mariadb:
        condition: service_healthy
      redis:
        condition: service_healthy
      flyingfish:
        condition: service_started

  ddnsserver:
    image: stefanwerfling/flyingfish_ddns:latest
    container_name: flyingfish_ddns
    environment:
      FLYINGFISH_DB_MYSQL_USERNAME: "${MARIADB_ROOT_USERNAME}"
      FLYINGFISH_DB_MYSQL_PASSWORD: "${MARIADB_ROOT_PASSWORD}"
      FLYINGFISH_DB_MYSQL_DATABASE: "${MARIADB_DATABASE}"
      FLYINGFISH_LOGGING_LEVEL: "${LOGGING_LEVEL}"
    networks:
      flyingfishNet:
        ipv4_address: 10.103.0.6
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"
    depends_on:
      mariadb:
        condition: service_healthy
      redis:
        condition: service_healthy
      flyingfish:
        condition: service_started

volumes:
  flyingfishDbData:
    driver: local
  flyingfishInfluxdbData:
    driver: local
  flyingfish:
    driver: local
  flyingfishLetsencrypt:
    driver: local
  flyingfishSsh:
    driver: local
    
networks:
  flyingfishNet:
    driver: bridge
    ipam:
      config:
        -  subnet: 10.103.0.0/16