Skip to content

Commit

Permalink
Merge pull request #3 from PresentJay/main
Browse files Browse the repository at this point in the history
feat: add dockerfile, docker-compose, and gunicorn+gevent based run
  • Loading branch information
thammegowda authored Apr 26, 2023
2 parents 846541b + e42371e commit 024f703
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.8.14-slim-buster

WORKDIR /app

RUN pip3 install --upgrade pip

COPY ./requirements.txt ./requirements.txt

# Install package from source code
RUN pip3 install -r ./requirements.txt

EXPOSE 5001
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3"

services:
nllb-translate:
container_name: nllb-translate
build: .
restart: always
ports:
- 5001:5001
volumes:
- ./nllb_serve:/app/nllb_serve
entrypoint: [ "gunicorn" ]
command:
[
"nllb_serve.app:app",
"-b",
"0.0.0.0:5001",
"-k",
"gevent",
"-w",
"4",
"--threads",
"8",
"--timeout",
"6000"
]
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
transformers>=4.21
Flask==2.1
torch>=1.12
torch>=1.12
gunicorn
gevent

0 comments on commit 024f703

Please sign in to comment.