build: divide dockerfile

feature/stdout-breaker
adldotori 1 year ago
parent 1fdf63741f
commit 930577a5be

@ -0,0 +1,27 @@
FROM python:3.10
WORKDIR /app/
ENV DEBIAN_FRONTEND=noninteractive
RUN \
apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get install -y python3.10 python3-pip curl && \
curl -sSL https://install.python-poetry.org | python3 -
ENV PATH "/root/.local/bin:$PATH"
COPY pyproject.toml .
COPY poetry.lock .
COPY api api
RUN poetry env use 3.10
RUN poetry config installer.max-workers 10
RUN poetry install --with tools
COPY . .
ENV PORT 8000
ENTRYPOINT ["poetry", "run", "serve"]

@ -17,10 +17,11 @@ COPY poetry.lock .
COPY api api
RUN poetry env use 3.10
RUN poetry config installer.max-workers 10
RUN poetry install --with tools
COPY . .
ENV PORT 8000
ENV PORT 8001
ENTRYPOINT ["poetry", "run", "serve"]

@ -5,14 +5,29 @@ services:
container_name: eval
image: eval
build:
dockerfile: Dockerfile
dockerfile: build/Dockerfile.cpu
context: .
volumes:
- ./static/:/app/static/
ports:
- "3000:3000"
- "7000:7000"
- "8000:8000" # eval port
env_file:
- .env
eval.gpu:
container_name: eval.gpu
image: eval.gpu
build:
dockerfile: build/Dockerfile.gpu
context: .
volumes: # if you want to decrease your model download time, use this.
- ../.cache/huggingface/:/root/.cache/huggingface/
- ./static/:/app/static/
ports:
- "7500:7500"
- "7501:7501"
- "3000:3000"
- "7000:7000"
- "8000:8000" # eval port
env_file:
- .env
@ -21,5 +36,5 @@ services:
reservations:
devices:
- driver: nvidia
device_ids: ["3"] # You can choose which GPU to use
device_ids: ["1"] # You can choose which GPU to use
capabilities: [gpu]

Loading…
Cancel
Save