Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "uv" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# syntax=docker/dockerfile:1
FROM python:3.9
FROM ubuntu:24.04

ARG UV_VERSION=0.10.9

WORKDIR /app

COPY requirements.txt /app/requirements.txt
ENV PATH="/root/.local/bin/:$PATH"

RUN apt-get update && apt-get install -y pipx ca-certificates libmagic1 \
&& pipx install "uv==${UV_VERSION}" \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt
COPY pyproject.toml uv.lock ./
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv sync runs right after copying only pyproject.toml/uv.lock, but the project metadata references README.md (and uv sync typically installs the local project by default). This can fail during build because README.md/source files are not present yet. Consider copying README.md (and any files needed to build the project) before uv sync, or run uv sync with the appropriate flag to avoid installing the project during this layer.

Suggested change
COPY pyproject.toml uv.lock ./
COPY pyproject.toml uv.lock README.md ./

Copilot uses AI. Check for mistakes.
RUN uv sync --no-dev --frozen

COPY . /app
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COPY . /app will include the entire build context (including .git/ and any locally-created .venv/), which can bloat the image and can also overwrite the virtual environment created by uv sync if a local .venv exists. Adding a .dockerignore to exclude .git, .venv, __pycache__, etc. avoids these issues and makes builds more deterministic.

Copilot uses AI. Check for mistakes.

CMD [ "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
CMD [ "uv", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Same/pepsifire
Copyright (c) 2022-2026 Same

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[project]
name = "fileuploader-fastapi"
version = "0.1.0"
description = "A FastAPI service for uploading and validating files."
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"fastapi>=0.135.1",
"python-magic>=0.4.27",
"python-multipart>=0.0.22",
"uvicorn>=0.41.0",
]

[build-system]
requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

259 changes: 259 additions & 0 deletions uv.lock

Large diffs are not rendered by default.