lose weight

This commit is contained in:
Adam 2023-02-10 19:25:30 -05:00
parent a8825132be
commit 1c7e659cba
4 changed files with 22 additions and 2 deletions

13
api/.dockerignore Normal file
View file

@ -0,0 +1,13 @@
bin
build
Dockerfile-alpine
lib
__pycache__
*/__pycache__
*/*/__pycache__
*/*/*/__pycache__
pyvenv.cfg
readme.md
run
test
chatbots_api.tar.gz

View file

@ -1,7 +1,10 @@
# syntax-docker/dockerfile:1 # syntax-docker/dockerfile:1
FROM pytorch/pytorch FROM alpine
WORKDIR /app WORKDIR /app
COPY requirements.txt requirements.txt COPY requirements.txt requirements.txt
RUN apk add --no-cache --virtual build-deps py3-pip rust cargo g++ openssl-dev python3-dev
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
RUN apk del build-deps
RUN rm -rf /var/cache/apk/*
COPY . . COPY . .
CMD [ "uvicorn", "chatbots:api", "--proxy-headers", "--host", "0.0.0.0", "--port", "8000"] CMD [ "uvicorn", "chatbots:api", "--proxy-headers", "--host", "0.0.0.0", "--port", "8000"]

View file

@ -1,3 +1,5 @@
#!/bin/bash #!/bin/bash
docker build -t chatbots_api . docker buildx build --platform=linux/amd64 --tag chatbots_api --load .
docker save chatbots_api | pigz > chatbots_api.tar.gz

View file

@ -1,3 +1,5 @@
fastapi fastapi
uvicorn uvicorn
transformers transformers
--extra-index-url https://download.pytorch.org/whl/cpu
torch