diff --git a/Dockerfile.gpu b/Dockerfile.gpu new file mode 100644 index 0000000..016ee17 --- /dev/null +++ b/Dockerfile.gpu @@ -0,0 +1,11 @@ +FROM pytorch/pytorch:1.7.1-cuda11.0-cudnn8-runtime + +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +ADD . /classla-api +WORKDIR /classla-api + +RUN pip install $(grep -ivE "torch" requirements.txt) + +CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"] diff --git a/docker-compose.yml b/docker-compose.yml index 3448363..a1d9b88 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,14 @@ -version: "3.8" +version: "3.7" services: app: build: . command: python -m flask run --host=0.0.0.0 - deploy: - resources: - reservations: - devices: - - driver: nvidia - count: all - capabilities: [ gpu ] + runtime: nvidia + environment: + - NVIDIA_VISIBLE_DEVICES=all + - NVIDIA_DRIVER_CAPABILITIES=all + - CUDA_VISIBLE_DEVICES=1 ports: - "5000:5000" volumes: - - .:/classla-api \ No newline at end of file + - .:/classla-api