Compare commits

..

2 Commits

Author SHA1 Message Date
Stedoss
649754166e Update cg to new version 2024-11-03 17:37:07 +00:00
Stedoss
ed57c15387 Use __main__ instead of sanic command to avoid docker incompat 2024-11-03 17:36:59 +00:00
3 changed files with 5 additions and 7 deletions

View File

@ -5,8 +5,6 @@ ENV PYTHONPATH=/app
WORKDIR /app WORKDIR /app
RUN apt update
COPY requirements.txt ./requirements.txt COPY requirements.txt ./requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt RUN pip3 install --no-cache-dir -r requirements.txt
@ -21,9 +19,6 @@ RUN sed -i '238s|return \[x for x in arr if lower_limit < x < upper_limit\]|arr_
COPY ./src/ ./src/ COPY ./src/ ./src/
ENV GUNICORN_CMD_ARGS="--bind=0.0.0.0:5000 --workers=16"
WORKDIR /app/src WORKDIR /app/src
# Run gunicorn with the application CMD ["python", "main.py"]
CMD ["sanic", "main", "--port=5000"]

View File

@ -1,4 +1,4 @@
ossapi==3.4.3 ossapi==3.4.3
circleguard==5.4.1 circleguard==5.4.2
brparser==1.0.4 brparser==1.0.4
sanic==24.6.0 sanic==24.6.0

View File

@ -291,3 +291,6 @@ async def process_similarity(request: Request):
except ValueError as e: except ValueError as e:
raise exceptions.BadRequest(str(e)) raise exceptions.BadRequest(str(e))
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)