mirror of
https://codeberg.org/privacy1st/httplz-docker
synced 2024-11-20 21:58:05 +01:00
init
This commit is contained in:
commit
adf5f93660
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
FROM rust:alpine as builder
|
||||
|
||||
# openssl not found -> openssl and openssl-dev
|
||||
# #include <stdlib.h> -> musl-dev
|
||||
RUN apk add openssl openssl-dev musl-dev
|
||||
|
||||
# --root dir: Directory to install packages into.
|
||||
RUN cargo install --root /build --bin httplz https
|
||||
|
||||
FROM alpine
|
||||
|
||||
COPY --from=builder /build/bin/httplz /bin/httplz
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Daniel Langbein <daniel@systemli.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
23
README.md
Normal file
23
README.md
Normal file
@ -0,0 +1,23 @@
|
||||
# httplz-docker
|
||||
|
||||
Docker Image containing the [httplz](https://github.com/thecoshman/http) Rust binary.
|
||||
|
||||
## Build
|
||||
|
||||
```shell
|
||||
sudo docker compose build
|
||||
```
|
||||
|
||||
## Starting a WebDAV server
|
||||
|
||||
The [docker-compose.yml](docker-compose.yml) file contains an example how to use the `httplz` binary as WebDAV server:
|
||||
|
||||
```shell
|
||||
sudo docker compose up -d
|
||||
```
|
||||
|
||||
`sudo docker stats` reports that it has a memory footprint of 14 MB (while idle).
|
||||
|
||||
## License
|
||||
|
||||
MIT, see [LICENSE](LICENSE).
|
44
docker-compose.yml
Normal file
44
docker-compose.yml
Normal file
@ -0,0 +1,44 @@
|
||||
version: '3.9'
|
||||
services:
|
||||
|
||||
# 14 MB memory usage while idle
|
||||
webdav:
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
command: sh -c "mkdir -p /data && httplz --port 8080 --auth username:secret-pwd --webdav --allow-write /data"
|
||||
ports:
|
||||
- '8080:8080/tcp'
|
||||
volumes:
|
||||
- ./data:/data
|
||||
|
||||
# Alternative ways to use httplz
|
||||
|
||||
# # 114 MB memory usage while idle
|
||||
# webdav:
|
||||
# image: archlinux
|
||||
# command: sh -c "pacman -Syu --noconfirm && pacman -S --needed --noconfirm httplz && mkdir -p /data && httplz --port 8080 --auth username:secret-pwd --webdav --allow-write /data"
|
||||
# ports:
|
||||
# - '8080:8080/tcp'
|
||||
# volumes:
|
||||
# - ./data:/data
|
||||
|
||||
# # 447 MB memory usage while idle
|
||||
# webdav:
|
||||
# image: rust
|
||||
# command: sh -c "cargo install https && mkdir -p /data && httplz --port 8080 --auth username:secret-pwd --webdav --allow-write /data"
|
||||
# ports:
|
||||
# - '8080:8080/tcp'
|
||||
# volumes:
|
||||
# - ./data:/data
|
||||
|
||||
|
||||
# # 390 MB memory usage while idle
|
||||
# webdav:
|
||||
# image: rust:alpine
|
||||
# # openssl not found -> openssl and openssl-dev
|
||||
# # #include <stdlib.h> -> musl-dev
|
||||
# command: sh -c "apk add openssl openssl-dev musl-dev && cargo install --bin httplz https && mkdir -p /data && httplz --port 8080 --auth username:secret-pwd --webdav --allow-write /data"
|
||||
# ports:
|
||||
# - '8080:8080/tcp'
|
||||
# volumes:
|
||||
# - ./data:/data
|
Loading…
Reference in New Issue
Block a user