-
Notifications
You must be signed in to change notification settings - Fork 0
Update docker image #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,15 +1,12 @@ | ||||||||||||||||||
| FROM python:3.12-slim-bookworm | ||||||||||||||||||
|
|
||||||||||||||||||
| RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | ||||||||||||||||||
|
|
||||||||||||||||||
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv | ||||||||||||||||||
| # python-alpine with uv | ||||||||||||||||||
| FROM ghcr.io/astral-sh/uv:python3.14-alpine3.23 | ||||||||||||||||||
|
|
||||||||||||||||||
| WORKDIR /app | ||||||||||||||||||
|
|
||||||||||||||||||
| COPY app/ /app/ | ||||||||||||||||||
| COPY pyproject.toml uv.lock /app/ | ||||||||||||||||||
| COPY pyproject.toml /app/ | ||||||||||||||||||
|
|
||||||||||||||||||
| RUN uv sync --frozen --no-dev --no-install-project | ||||||||||||||||||
| RUN uv sync --no-dev --no-install-project | ||||||||||||||||||
|
Comment on lines
+7
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Without copying Proposed fix COPY pyproject.toml /app/
+COPY uv.lock /app/
-RUN uv sync --no-dev --no-install-project
+RUN uv sync --frozen --no-dev --no-install-project📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| EXPOSE 8000 | ||||||||||||||||||
| ENTRYPOINT ["/app/start.sh"] | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,6 @@ lint: | |
| uv run isort --check . | ||
| uv run flake8 . | ||
| uv run mypy --namespace-packages --show-error-codes ./app | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The Either remove the mypy step from the Makefile or restore mypy in dev dependencies. Proposed fix to remove mypy from lint target lint:
uv run black --check .
uv run isort --check .
uv run flake8 .
- uv run mypy --namespace-packages --show-error-codes ./app🤖 Prompt for AI Agents |
||
|
|
||
| docker-up: | ||
| docker compose up | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,23 +1,28 @@ | ||||||||||
| # Pyuploadcare Example app | ||||||||||
|
|
||||||||||
| This example project demonstrates the pyuploadcare capabilities. | ||||||||||
| The project is based on Python 3.12 and Django 4.2.10. | ||||||||||
|
|
||||||||||
| * [Installation](#installation) | ||||||||||
| * [Using docker](#using-docker) | ||||||||||
| * [Without docker](#without-docker) | ||||||||||
| * [Usage](#usage) | ||||||||||
| * [Configuration](#configuration) | ||||||||||
| * [Project section](#project-section) | ||||||||||
| * [Files section](#files-section) | ||||||||||
| * [File Groups section](#file-groups-section) | ||||||||||
| * [Files uploading](#files-uploading) | ||||||||||
| * [Conversion](#conversion) | ||||||||||
| * [Documents conversion](#documents-conversion) | ||||||||||
| * [Video conversion](#video-conversion) | ||||||||||
| * [Webhooks](#webhooks) | ||||||||||
| * [Posts section](#posts-section) | ||||||||||
| * [Useful links](#useful-links) | ||||||||||
| The project is based on Python 3.14 and Django 4.2.10. | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Django version mismatch with pyproject.toml. README states Django 4.2.10, but pyproject.toml specifies 🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| - [Pyuploadcare Example app](#pyuploadcare-example-app) | ||||||||||
| - [Installation](#installation) | ||||||||||
| - [Using Docker](#using-docker) | ||||||||||
| - [Without docker](#without-docker) | ||||||||||
| - [Usage](#usage) | ||||||||||
| - [Configuration](#configuration) | ||||||||||
| - [Project section](#project-section) | ||||||||||
| - [Files section](#files-section) | ||||||||||
| - [File Groups section](#file-groups-section) | ||||||||||
| - [Files uploading](#files-uploading) | ||||||||||
| - [Conversion](#conversion) | ||||||||||
| - [Documents conversion](#documents-conversion) | ||||||||||
| - [Video conversion](#video-conversion) | ||||||||||
| - [Addons](#addons) | ||||||||||
| - [Object recognition via AWS](#object-recognition-via-aws) | ||||||||||
| - [ClamAV Antivirus scan](#clamav-antivirus-scan) | ||||||||||
| - [Background removing](#background-removing) | ||||||||||
| - [Webhooks](#webhooks) | ||||||||||
| - [Posts section](#posts-section) | ||||||||||
| - [Useful links](#useful-links) | ||||||||||
|
|
||||||||||
| ## Installation | ||||||||||
|
|
||||||||||
|
|
@@ -184,7 +189,7 @@ Conversion result page also includes information about how conversion is going. | |||||||||
|
|
||||||||||
| User can execute operations that wrapped as addons. | ||||||||||
| There are three implemented addons: | ||||||||||
| - background removing | ||||||||||
| - background removing | ||||||||||
| - virus scanning | ||||||||||
| - object recognition | ||||||||||
|
|
||||||||||
|
|
@@ -197,7 +202,7 @@ You only need to choose a file to start a recognition | |||||||||
|
|
||||||||||
|  | ||||||||||
|
|
||||||||||
| After all corresponding part of file's `adddata` is rendered | ||||||||||
| After all corresponding part of file's `adddata` is rendered | ||||||||||
| and you can get into full file information if needed | ||||||||||
|
Comment on lines
+205
to
206
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo: "adddata" should be "appdata". The text mentions Proposed fix-After all corresponding part of file's `adddata` is rendered
+After all corresponding part of file's `appdata` is rendered📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
|  | ||||||||||
|
|
@@ -225,7 +230,7 @@ so you may see `IN_PROGRESS` status page with refresh button | |||||||||
|
|
||||||||||
|  | ||||||||||
|
|
||||||||||
| Image with removed background will be put into new file, | ||||||||||
| Image with removed background will be put into new file, | ||||||||||
| so the result page has both links to the original file and created one | ||||||||||
|
|
||||||||||
|  | ||||||||||
|
|
@@ -273,10 +278,10 @@ To create a new post, click on the `Add` button in posts index page. The post fo | |||||||||
|  | ||||||||||
|
|
||||||||||
| ## Useful links | ||||||||||
| * [Uploadcare documentation](https://uploadcare.com/docs/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) | ||||||||||
| * [Upload API reference](https://uploadcare.com/api-refs/upload-api/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) | ||||||||||
| * [REST API reference](https://uploadcare.com/api-refs/rest-api/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) | ||||||||||
| * [Contributing guide](https://github.com/uploadcare/.github/blob/master/CONTRIBUTING.md) | ||||||||||
| * [Security policy](https://github.com/uploadcare/pyuploadcare/security/policy) | ||||||||||
| * [Uploadcare documentation](https://uploadcare.com/docs/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) | ||||||||||
| * [Upload API reference](https://uploadcare.com/api-refs/upload-api/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) | ||||||||||
| * [REST API reference](https://uploadcare.com/api-refs/rest-api/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) | ||||||||||
| * [Contributing guide](https://github.com/uploadcare/.github/blob/master/CONTRIBUTING.md) | ||||||||||
| * [Security policy](https://github.com/uploadcare/pyuploadcare/security/policy) | ||||||||||
| * [Support](https://github.com/uploadcare/.github/blob/master/SUPPORT.md) | ||||||||||
| * [A Python library for Uploadcare service](https://github.com/uploadcare/pyuploadcare) | ||||||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a non-root user for improved security.
The container runs as root by default, which is a security risk. Static analysis (Trivy DS-0002) flagged this. Add a non-root user to reduce the attack surface.
Proposed fix to add non-root user
🧰 Tools
🪛 Trivy (0.69.1)
[error] 1-1: Image user should not be 'root'
Specify at least 1 USER command in Dockerfile with non-root user as argument
Rule: DS-0002
Learn more
(IaC/Dockerfile)
🤖 Prompt for AI Agents