| FROM rasa/duckling |
|
|
| RUN apt update && \ |
| apt install -y wget curl git build-essential libssl-dev zlib1g-dev libbz2-dev \ |
| libreadline-dev libsqlite3-dev libncurses5-dev libffi-dev liblzma-dev libncursesw5-dev \ |
| xz-utils tk-dev supervisor software-properties-common |
|
|
|
|
| RUN add-apt-repository contrib && \ |
| add-apt-repository non-free && \ |
| apt update && \ |
| apt install -y unrar |
|
|
|
|
|
|
| |
| RUN curl https://pyenv.run | bash |
|
|
| |
| ENV PYENV_ROOT="/root/.pyenv" |
| ENV PATH="$PYENV_ROOT/bin:$PATH" |
| RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc && \ |
| echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc && \ |
| echo 'eval "$(pyenv init --path)"' >> ~/.bashrc && \ |
| echo 'eval "$(pyenv init -)"' >> ~/.bashrc && \ |
| echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc |
|
|
| |
| RUN pyenv install 3.10.12 && \ |
| pyenv global 3.10.12 |
|
|
|
|
| WORKDIR /app |
| COPY ./requirements.txt . |
|
|
| RUN pyenv exec python3 -m venv /app/venv |
| RUN /app/venv/bin/pip install --no-cache-dir --upgrade pip |
| RUN /app/venv/bin/pip install --no-cache-dir -r requirements.txt |
|
|
| COPY ./src/ ./src |
| COPY ./ckpt/ ./ckpt |
|
|
| ENV API_HOST=0.0.0.0 |
| ENV API_PORT=80 |
| ENV MODEL_TYPE=duckling_operator |
| ENV DUCKLING_HOST=localhost |
| ENV DUCKLING_PORT=8000 |
| ENV OPERATOR_MODEL_TYPE=bert |
| ENV DEVICE=cpu |
| |
| |
| RUN mkdir -p /etc/supervisor/conf.d |
| COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf |
|
|
| |
| EXPOSE 80 |
|
|
| |
| CMD ["/usr/bin/supervisord"] |
|
|