Simple file sharing backend
225
A very simple file sharing backend running on Node.js and Express.js.
For more information, please check this project's Github repository
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
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",
}
Content type
Image
Digest
Size
44.4 MB
Last updated
over 4 years ago
docker pull hathoute/file-sharing-backend