forked from lkrsnik/classla-api
Merge pull request 'Docker + GPUs.' (#1) from mihasinkec/classla-api:master into master
Reviewed-on: lkrsnik/classla-api#1
This commit is contained in:
commit
f406ccc9fc
11
Dockerfile.gpu
Normal file
11
Dockerfile.gpu
Normal file
|
@ -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"]
|
|
@ -1,16 +1,14 @@
|
||||||
version: "3.8"
|
version: "3.7"
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
command: python -m flask run --host=0.0.0.0
|
command: python -m flask run --host=0.0.0.0
|
||||||
deploy:
|
runtime: nvidia
|
||||||
resources:
|
environment:
|
||||||
reservations:
|
- NVIDIA_VISIBLE_DEVICES=all
|
||||||
devices:
|
- NVIDIA_DRIVER_CAPABILITIES=all
|
||||||
- driver: nvidia
|
- CUDA_VISIBLE_DEVICES=1
|
||||||
count: all
|
|
||||||
capabilities: [ gpu ]
|
|
||||||
ports:
|
ports:
|
||||||
- "5000:5000"
|
- "5000:5000"
|
||||||
volumes:
|
volumes:
|
||||||
- .:/classla-api
|
- .:/classla-api
|
||||||
|
|
Loading…
Reference in New Issue
Block a user