Gros refactoring
This commit is contained in:
parent
4a6bfc951f
commit
dd22432b48
12 changed files with 18 additions and 18 deletions
|
@ -37,7 +37,7 @@ RUN poetry config virtualenvs.create false \
|
|||
COPY conf/policy.xml /etc/ImageMagick-6/policy.xml
|
||||
|
||||
# Expose the application port
|
||||
EXPOSE 8000
|
||||
EXPOSE 8080
|
||||
|
||||
# Copy the application code
|
||||
COPY conf ./conf
|
||||
|
@ -49,4 +49,4 @@ COPY *.py .
|
|||
COPY *.lua .
|
||||
|
||||
# Run the application
|
||||
CMD ["poetry", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
CMD ["poetry", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
|
|
@ -2,4 +2,4 @@ docker stop fabriquedoc
|
|||
docker rm fabriquedoc
|
||||
docker network create fabriquedoc
|
||||
# Ce programme sert à lancer le job_dispatcher dans un docker localement pour tester
|
||||
docker run -p 8000:8000 --env-file .env --name fabriquedoc --network fabriquedoc local/fabriquedoc
|
||||
docker run -p 8080:8080 --env-file .env --name fabriquedoc --network fabriquedoc local/fabriquedoc
|
|
@ -74,4 +74,4 @@ def test_getroot():
|
|||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
logger.info("Starting the application")
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
||||
uvicorn.run(app, host="0.0.0.0", port=8080)
|
|
@ -1,7 +1,7 @@
|
|||
import requests
|
||||
|
||||
# Base URL for the API
|
||||
BASE_URL = "http://127.0.0.1:8000"
|
||||
BASE_URL = "http://127.0.0.1:8080"
|
||||
|
||||
# Function to get the access token
|
||||
def get_access_token():
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Test your FastAPI endpoints
|
||||
|
||||
# @name login
|
||||
POST http://127.0.0.1:8000/token/
|
||||
POST http://127.0.0.1:8080/token/
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
|
||||
username=francois&password=password
|
||||
|
@ -9,7 +9,7 @@ username=francois&password=password
|
|||
|
||||
###
|
||||
|
||||
POST http://127.0.0.1:8000/generer/
|
||||
POST http://127.0.0.1:8080/generer/
|
||||
Content-Type: application/json
|
||||
Accept: application/zip
|
||||
Authorization: Bearer {{authToken}}
|
||||
|
@ -31,7 +31,7 @@ Authorization: Bearer {{authToken}}
|
|||
|
||||
###
|
||||
|
||||
POST http://127.0.0.1:8000/generer/
|
||||
POST http://127.0.0.1:8080/generer/
|
||||
Content-Type: application/json
|
||||
Accept: application/zip
|
||||
Authorization: Bearer {{authToken}}
|
||||
|
@ -53,7 +53,7 @@ Authorization: Bearer {{authToken}}
|
|||
|
||||
###
|
||||
|
||||
POST http://127.0.0.1:8000/generer/
|
||||
POST http://127.0.0.1:8080/generer/
|
||||
Content-Type: application/json
|
||||
Accept: application/pdf
|
||||
Authorization: Bearer {{authToken}}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
curl -X POST --location "http://127.0.0.1:8000/images/" \
|
||||
curl -X POST --location "http://127.0.0.1:8080/images/" \
|
||||
-H "Accept: application/json" \
|
||||
-H "Content-Type: multipart/form-data; boundary=boundary" \
|
||||
-F "file=@logo-case-cocher.png"
|
||||
|
||||
curl -X GET --location "http://127.0.0.1:8000/images/"
|
||||
curl -X GET --location "http://127.0.0.1:8080/images/"
|
||||
|
||||
curl -X DELETE --location "http://127.0.0.1:8000/images/logo-case-cocher.png"
|
||||
curl -X DELETE --location "http://127.0.0.1:8080/images/logo-case-cocher.png"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue