Skip to content

Commit 48c1cf6

Browse files
committed
Add Dockerfile, license, and README Docker instructions
1 parent 8cf168f commit 48c1cf6

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM python:3.12-slim
2+
3+
ENV PYTHONUNBUFFERED=1 \
4+
PIP_NO_CACHE_DIR=1
5+
6+
WORKDIR /app
7+
8+
RUN apt-get update && apt-get install -y --no-install-recommends \
9+
build-essential \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
COPY requirements.txt .
13+
RUN pip install --upgrade pip && pip install -r requirements.txt
14+
15+
COPY . .
16+
17+
EXPOSE 8000
18+
19+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Lunaticsm
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 2 --proxy-headers
4545

4646
Visit `/` for a minimalist landing page with real-time usage metrics, and `/api-info` for a human-friendly API guide.
4747

48+
### Docker
49+
50+
Build and run with Docker:
51+
52+
```bash
53+
docker build -t image-uploader .
54+
docker run --rm -p 8000:8000 --env-file .env -v $(pwd)/uploads:/app/uploads image-uploader
55+
```
56+
57+
Customize `DB_URL`, `UPLOAD_DIR`, etc. via the `--env-file` or individual `-e` flags.
58+
4859
## API Overview
4960

5061
| Method | Path | Description |
@@ -78,3 +89,7 @@ The suite bootstraps the FastAPI app against a temporary SQLite database to cove
7889
- For higher concurrency, point `DB_URL` at a server database and keep the provided SQLite connection args if you stay on SQLite.
7990
- Mount or back up `UPLOAD_DIR` storage if files need to persist beyond the cleaner retention window.
8091
- Tune `RATE_LIMIT_PER_MINUTE`, `MAX_FILE_SIZE_BYTES`, and `CACHE_MAX_AGE_SECONDS` to match your traffic patterns.
92+
93+
## License
94+
95+
Released under the [MIT License](LICENSE).

0 commit comments

Comments
 (0)