File size: 1,985 Bytes
54ff1bb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | # FROM python:3.10-slim
# ENV PYTHONUNBUFFERED=True \
# PORT=9090
# WORKDIR /app
# COPY requirements.txt .
# RUN apt-get update && apt-get install -y --no-install-recommends \
# libgl1 \
# libglib2.0-0
# RUN pip install --no-cache-dir -r requirements.txt
# COPY . ./
# EXPOSE 6006
# EXPOSE 9090
# CMD exec gunicorn --preload --bind :$PORT --workers 1 --threads 8 --timeout 0 _wsgi:app
FROM wowai/base-hf:v1.12.0
WORKDIR /tmp
COPY requirements.txt .
ENV MODEL_DIR=/data/models
ENV RQ_QUEUE_NAME=default
ENV REDIS_HOST=redis
ENV REDIS_PORT=6379
ENV AIXBLOCK_USE_REDIS=true
ENV HOST_NAME=https://dev.aixblock.io
COPY uwsgi.ini /etc/uwsgi
RUN apt-get -qq update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends --assume-yes \
git
RUN apt install libpq-dev -y uwsgi
RUN apt install build-essential
RUN apt install -y libpq-dev python3-dev
RUN pip install psycopg2
RUN pip install python-box
RUN apt install -y nvidia-cuda-toolkit --fix-missing
# RUN pip install opencv-python
# RUN pip install keras
# RUN pip install --upgrade pip
# RUN pip install "pip>=19"
# RUN pip install tensorflow
# RUN pip install tensorflow_hub
RUN pip install --upgrade colorama
RUN pip install aixblock-sdk
RUN apt-get update
RUN apt install -y nvidia-cuda-toolkit --fix-missing
RUN pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu12.2
RUN apt-get update
RUN apt-get -qq -y install curl --fix-missing
WORKDIR /app
COPY . ./
RUN --mount=type=cache,target=/root/.cache
RUN pip install -r requirements.txt
WORKDIR /app
ENV PYTHONUNBUFFERED=True \
PORT=${PORT:-9090} \
PIP_CACHE_DIR=/.cache
RUN python3.10 -m pip install --upgrade Flask
RUN python3.10 -m pip install gradio==3.43.1
COPY . ./
EXPOSE 9090 6006 23456
CMD exec gunicorn --preload --bind :$PORT --workers 1 --threads 8 --timeout 0 _wsgi:app
|