rewrite URL shortener in Rust

This commit is contained in:
2026-07-10 04:46:34 +00:00
parent a250ce4c1d
commit a6e8be7553
16 changed files with 2906 additions and 1102 deletions
+12 -7
View File
@@ -1,14 +1,19 @@
services:
urlshort:
image: python:3.11-slim
working_dir: /app
command: ["python", "-u", "urlshort.py", "config.json"]
ushort:
image: sodium/ushort:latest
build:
context: .
command: ["/app/config.toml"]
ports:
- "127.0.0.1:18082:8080"
volumes:
- ./urlshort.py:/app/urlshort.py:ro
- ./config.json:/app/config.json:ro
- ./static:/app/static:ro
- "${USHORT_CONFIG:-./config.toml}:/app/config.toml:ro"
- ./data:/app/data
user: "${USHORT_UID:-1001}:${USHORT_GID:-1001}"
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
restart: unless-stopped