From 009972ae883a8521a9eefd33f913f433d63ec651 Mon Sep 17 00:00:00 2001 From: Gunwant Jain Date: Wed, 6 Jan 2021 00:13:07 +0530 Subject: [PATCH] readme: use markdown, add deployment examples Signed-off-by: Gunwant Jain --- readme => readme.md | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) rename readme => readme.md (52%) diff --git a/readme b/readme.md similarity index 52% rename from readme rename to readme.md index c6905d8..169df1f 100644 --- a/readme +++ b/readme.md @@ -1,6 +1,7 @@ -USAGE +Usage ----- +```plain POST / accepts raw data in the body of the request and responds with a URL @@ -13,10 +14,12 @@ USAGE GET /p/ retrieves the HTML page with syntax-highlighted content for the paste with id `` +``` -EXAMPLES +Examples -------- +```plain Paste a file named 'file.txt' using cURL: curl --data-binary @file.txt https://bin.wantguns.dev @@ -34,3 +37,38 @@ EXAMPLES If the uploaded data binary is parsed as "text/*", then the paste will be syntax highlighted +``` + +Deployment +---------- + +### Traefik + +```yaml +## (... Traefik service configuration ...) ## + + pastebin: + image: wantguns/bin + restart: always + container_name: pastebin + ports: + - 127.0.0.1:6162:6162 + environment: + - ROCKET_PORT=6162 + - THEME= + - HOST=${BIN_DOMAIN} + volumes: + - /path/to/local/upload:/app/upload + labels: + - "traefik.enable=true" + - "traefik.http.routers.pastebin.rule=Host(`${BIN_DOMAIN}`)" + - "traefik.http.routers.pastebin.entrypoints=secure" + - "traefik.http.routers.pastebin.tls.certresolver=le" + - "traefik.http.services.pastebin.loadbalancer.server.port=6162" + networks: + - bin_network + +networks: + - bin_network + ``` +