Retour à pip install au lieu de Poetry

This commit is contained in:
François Pelletier 2025-01-08 14:14:51 -05:00
parent 2a7b056698
commit a5403db464
11 changed files with 158 additions and 3958 deletions

View file

@ -17,21 +17,14 @@ RUN apt-get -y update && apt-get install -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
# Add Poetry to PATH
ENV PATH="/root/.local/bin:$PATH"
# Set the working directory
WORKDIR /app
# Copy only pyproject.toml and poetry.lock (if it exists)
COPY pyproject.toml poetry.lock* ./
# Copier les fichiers de configuration de Poetry
COPY requirements.txt .
# Install project dependencies
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
# Installer les dépendances
RUN pip install -r requirements.txt
# Policy for ImageMagick
COPY conf/policy.xml /etc/ImageMagick-6/policy.xml
@ -49,4 +42,4 @@ COPY *.py .
COPY *.lua .
# Run the application
CMD ["poetry", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]

View file

@ -1,19 +0,0 @@
import os
import base64
import hashlib
import hmac
def hash_password(password):
# Use a random salt
salt = os.urandom(16)
# Use HMAC-SHA256 for hashing
key = hashlib.sha256(salt).digest()
hashed = hmac.new(key, password.encode('utf-8'), hashlib.sha256).digest()
# Combine salt and hash, and encode in base64
return base64.b64encode(salt + hashed).decode('utf-8')
if __name__ == "__main__":
password = input("Enter the password to hash: ")
hashed_password = hash_password(password)
print(f"Hashed password: {hashed_password}")
print("Add this to your .env file as PASS_HASH=<hashed_password>")

2462
backend/poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,105 +0,0 @@
[tool.poetry]
name = "fabriquedoc-backend"
version = "0.1.0"
description = "Backend for FabriqueDoc"
authors = ["Your Name <your.email@example.com>"]
[tool.poetry.dependencies]
python = "^3.13"
altair = "5.5.0"
annotated-types = "0.7.0"
anyio = "4.7.0"
attrs = "24.3.0"
blinker = "1.9.0"
build = "1.2.2.post1"
CacheControl = "0.14.1"
cachetools = "5.5.0"
certifi = "2024.12.14"
cffi = "1.17.1"
charset-normalizer = "3.4.1"
cleo = "2.1.0"
click = "8.1.8"
crashtest = "0.4.1"
distlib = "0.3.9"
dulwich = "0.21.7"
emoji = "2.14.0"
fastapi = "0.115.6"
fastjsonschema = "2.21.1"
filelock = "3.16.1"
gitdb = "4.0.11"
GitPython = "3.1.43"
h11 = "0.14.0"
httpcore = "1.0.7"
httpx = "0.28.1"
idna = "3.10"
installer = "0.7.0"
jaraco-classes = "3.4.0"
Jinja2 = "3.1.5"
jsonschema = "4.23.0"
jsonschema-specifications = "2024.10.1"
keyring = "24.3.1"
markdown-it-py = "3.0.0"
MarkupSafe = "3.0.2"
mdformat = "0.7.21"
mdurl = "0.1.2"
more-itertools = "10.5.0"
msgpack = "1.1.0"
narwhals = "1.20.1"
numpy = "2.2.1"
opencv-python = "4.10.0.84"
packaging = "24.2"
pandas = "2.2.3"
passlib = "1.7.4"
pexpect = "4.9.0"
pillow = "11.0.0"
pkginfo = "1.12.0"
platformdirs = "4.3.6"
poetry = "1.8.5"
poetry-core = "1.9.1"
poetry-plugin-export = "1.8.0"
protobuf = "5.29.2"
ptyprocess = "0.7.0"
pyarrow = "18.1.0"
pycparser = "2.22"
pydantic = "2.10.4"
pydantic_core = "2.27.2"
pydeck = "0.9.1"
Pygments = "2.18.0"
PyJWT = "2.10.1"
pypandoc = "1.14"
pyproject_hooks = "1.2.0"
python-dateutil = "2.9.0.post0"
python-dotenv = "1.0.1"
python-multipart = "0.0.20"
pytz = "2024.2"
RapidFuzz = "3.11.0"
referencing = "0.35.1"
requests = "2.32.3"
requests-toolbelt = "1.0.0"
rich = "13.9.4"
rpds-py = "0.22.3"
shellingham = "1.5.4"
six = "1.17.0"
smmap = "5.0.1"
sniffio = "1.3.1"
starlette = "0.41.3"
streamlit = "1.41.1"
tenacity = "9.0.0"
toml = "0.10.2"
tomlkit = "0.13.2"
tornado = "6.4.2"
trove-classifiers = "2024.10.21.16"
typing_extensions = "4.12.2"
tzdata = "2024.2"
urllib3 = "2.3.0"
uvicorn = "0.34.0"
virtualenv = "20.28.0"
Wand = "0.6.13"
xattr = "1.1.0"
[tool.poetry.dev-dependencies]
# Add any development dependencies here
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

92
backend/requirements.txt Normal file
View file

@ -0,0 +1,92 @@
altair
annotated-types
anyio
attrs
blinker
build
CacheControl
cachetools
certifi
cffi
charset-normalizer
cleo
click
crashtest
distlib
dulwich
emoji
fastapi
fastjsonschema
filelock
gitdb
GitPython
h11
httpcore
httpx
idna
installer
jaraco.classes
jaraco.context
jaraco.functools
Jinja2
jsonschema
jsonschema-specifications
keyring
markdown-it-py
MarkupSafe
mdformat
mdurl
more-itertools
msgpack
narwhals
numpy
opencv-python
packaging
pandas
passlib
pexpect
pillow
pkginfo
platformdirs
poetry
poetry-core
poetry-plugin-export
protobuf
ptyprocess
pyarrow
pycparser
pydantic
pydantic_core
pydeck
Pygments
PyJWT
pypandoc
pyproject_hooks
python-dateutil
python-dotenv
python-multipart
pytz
RapidFuzz
referencing
requests
requests-toolbelt
rich
rpds-py
shellingham
six
smmap
sniffio
starlette
streamlit
tenacity
toml
tomlkit
tornado
trove-classifiers
typing_extensions
tzdata
urllib3
uvicorn
virtualenv
Wand
xattr