Sign inSign up

hathoute/file-sharing-backend

By hathoute

Updated over 4 years ago

Simple file sharing backend

Image
0

225

hathoute/file-sharing-backend repository overview

File Sharing Backend

A very simple file sharing backend running on Node.js and Express.js.

Github repository

For more information, please check this project's Github repository

Deployment example: docker-compose.yml

In this example, the image is using MariaDB as a database

version: "3.7"
services:
  file-sharing-backend:
    image: "hathoute/file-sharing-backend"
    restart: always
    ports:
      - "3001:3001"
    volumes:
      - ./uploads:/app/uploads        # Mount directory ./uploads to /app/uploads inside the container
    environment:
      NODE_ENV: production           # We want to make sure we use node optimizations.
      DB_HOST: mariadb                   # We use mariadb image below, so the hostname is "mariadb"
      DB_USER: fsb_usr                      # MariaDB user
      DB_PASSWORD: fsb_passwd   # MariaDB password
      DB_NAME: fsb                            # MariaDB database (make sure 'DB_USER'@'DB_HOST' has privileges on this database)
      API_BASE_PATH: /api/files        # API Base path (eg. http://host:port/api/files)

  mariadb:
    image: mariadb:10.7
    ports:
      - 3306:3306
    environment:
      - MYSQL_ROOT_PASSWORD=fsb_rootpasswd
      - MYSQL_PASSWORD=fsb_passwd
      - MYSQL_USER=fsb_usr
      - MYSQL_DATABASE=fsb

Environment variables

Every config field in config/default.json is bound to an environment variable that can be added to docker-compose.yml

    "server": {
        "host": "SERVER_HOST",
        "port": "SERVER_PORT",
    },
    "api": {
        "base_path": "API_BASE_PATH",
    },
    "database": {
        "host": "DB_HOST",
        "port": "DB_PORT",
        "user": "DB_USER",
        "password": "DB_PASSWORD",
        "database": "DB_NAME",
    },
    "uploads": {
        "path": "UPLOAD_PATH",
        "max_name_length": "MAX_NAME_LEN",
        "max_size": "MAX_FILE_SIZE",
    }

Tag summary

Content type

Image

Digest

Size

44.4 MB

Last updated

over 4 years ago

docker pull hathoute/file-sharing-backend