Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

ohidurbappy/fileserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Fileserver

A simple, lightweight, and containerized file server built with Go.

Description

This project provides a basic HTTP server that serves static files from a specified directory. It's designed to be run in a Docker container and is configurable via environment variables.

Features

  • Serves static files over HTTP.
  • Configurable port and upload directory.
  • Containerized with Docker for easy deployment.
  • Multi-stage Docker build for a small final image size.
  • Includes a docker-compose.yml for easy setup.

Getting Started

Prerequisites

Installation & Running

  1. Clone the repository:

    git clone https://github.com/ohidurbappy/fileserver.git
    cd fileserver
  2. Using Docker Compose (recommended):

    docker-compose up -d
  3. Using Docker:

    docker build -t go-fileserver .
    docker run -d -p 3000:3000 -v $(pwd)/uploads:/app/uploads --name go-fileserver go-fileserver

Usage

Once the server is running, you can access the files in the uploads directory by navigating to http://localhost:3000/uploads/ in your browser.

Any files you place in the local ./uploads directory will be accessible.

Configuration

The following environment variables can be used to configure the server:

Variable Description Default
PORT The port the server runs on. 3000
UPLOAD_DIR The directory to serve files from. ./uploads

These can be set in the docker-compose.yml file or via the -e flag with docker run.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published