This Docker image is built to serve static files using Nginx. You can use it to quickly serve files from a specific directory, with directory listing enabled, using Docker.
- Based on nginx:alpine for a lightweight and efficient image.
- Auto-indexing of directories enabled by default.
- Simple and configurable through a Docker volume.
First, you need to pull the Docker image from DockerHub:
docker pull blackiq/litestream:1.0.0To run the container and serve your files, use the following docker run command:
docker run -p 8080:80 -v /path/to/your/files:/media --rm --name file-server blackiq/litestream:1.0.0- 8080:80: Maps port
80in the container to port8080on your host machine. You can adjust this as needed. - /path/to/your/files: Replace this with the path to the directory you want to serve. The directory will be mounted to
/mediain the container. - --rm: Automatically removes the container after stopping it.
- file-server: The name of the container. You can customize this.
After running the command, you can visit http://ip:8080 (or the port you specified) to access your files.
docker run -p 10000:80 -v ~/movies:/media --rm --name movies-server blackiq/litestream:1.0.0This will serve the files in the ~/movies directory and make them accessible via http://localhost:10000.
This image uses a custom Nginx configuration (default.conf) to serve files with directory listing enabled. The following is the default configuration used in the container:
server {
listen 80;
listen [::]:80;
location / {
root /media;
autoindex on;
}
}If you want to customize the configuration, you can modify the default.conf and rebuild the image.
If you want to build the image yourself, use the following steps:
-
Clone the repository:
git clone https://github.com/blackiq/litestream.git cd litestream -
Build the Docker image:
docker build -t my-litestream . -
Run the container:
docker run -p 8080:80 -v /path/to/your/files:/media --rm --name my-litestream-container my-litestream
-
Build the Docker image:
docker build -t my-litestream:latest . -
Tag the image for DockerHub:
docker tag my-litestream <your-dockerhub-username>/my-litestream:latest
-
Push the image to DockerHub:
docker push <your-dockerhub-username>/my-litestream:latest
Remember to login before push with
docker logincommand.
You can now push it into your Git server or any other Git services like GitHub, GitLab and others.
-
Initialize a Git repository (if not already):
git init git add . git commit -m "Initial commit"
-
Add the remote repository:
git remote add origin https://github.com/<your-github-username>/my-litestream.git
-
Push the code to GitHub:
git push -u origin main
This project is licensed under the MIT License.
Let me know if you need any further modifications or help with publishing!