34 lines
795 B
Docker
34 lines
795 B
Docker
FROM python:3.9-slim
|
|
|
|
# Maintainer info
|
|
LABEL maintainer="khaledihkh@gmail.com"
|
|
|
|
# Make working directories
|
|
RUN mkdir -p /service
|
|
WORKDIR /service
|
|
|
|
# Upgrade pip with no cache
|
|
RUN pip install --no-cache-dir -U pip
|
|
|
|
# Copy application requirements file to the created working directory
|
|
COPY requirements.txt .
|
|
|
|
# Install application dependencies from the requirements file
|
|
RUN pip install -r requirements.txt
|
|
|
|
# Copy every file in the source folder to the created working directory
|
|
COPY . .
|
|
RUN pip install ./src/piraye
|
|
RUN pip install transformers[sentencepiece]
|
|
|
|
|
|
ENV NER_MODEL_NAME ""
|
|
ENV NORMALIZE "False"
|
|
ENV SHORT_MODEL_NAME ""
|
|
ENV LONG_MODEL_NAME ""
|
|
ENV POS_MODEL_NAME ""
|
|
ENV BATCH_SIZE "4"
|
|
ENV DEVICE "gpu"
|
|
|
|
EXPOSE 80
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"] |