change deployment to use docker-compose

This commit is contained in:
2026-03-18 02:40:02 +08:00
parent db5aefedeb
commit 3d44ce6e3d
3 changed files with 53 additions and 19 deletions
+6 -4
View File
@@ -1,12 +1,14 @@
services:
urlshort:
build:
context: .
dockerfile: Dockerfile
image: python:3.11-slim
working_dir: /app
command: ["python", "-u", "urlshort.py", "config.json"]
ports:
- "8080:8080"
volumes:
# Persist the SQLite database outside the container
- ./urlshort.py:/app/urlshort.py:ro
- ./config.json:/app/config.json:ro
- ./static:/app/static:ro
- ./data:/app/data
restart: unless-stopped