diff --git a/Dockerfile b/Dockerfile index db3c5b3..48accb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,21 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 ENV DEBIAN_FRONTEND "noninteractive" ENV LANG "ja_JP.UTF-8" ENV PYTHONIOENCODING "utf-8" RUN apt update -y \ + && apt install -y software-properties-common \ + && add-apt-repository -y ppa:deadsnakes/ppa \ && apt install -y \ language-pack-ja \ build-essential \ - git \ wget \ mecab \ libmecab-dev \ mecab-ipadic-utf8 \ - python3 \ - python3-dev \ + python3.10 \ + python3.10-dev \ python3-pip \ && rm -rf /var/lib/apt/lists/* @@ -25,7 +26,7 @@ RUN wget http://www.phontron.com/kytea/download/kytea-0.4.7.tar.gz RUN wget https://patch-diff.githubusercontent.com/raw/neubig/kytea/pull/24.patch RUN tar zxvf kytea-0.4.7.tar.gz \ && cd kytea-0.4.7 \ - && git apply ../24.patch \ + && patch -p1 < ../24.patch \ && ./configure && make && make install && ldconfig -v \ && cd .. && rm -rf kytea-0.4.7.tar.gz kytea-0.4.7 @@ -37,9 +38,11 @@ COPY ./pyproject.toml ./pyproject.toml COPY ./poetry.lock ./poetry.lock COPY ./README.md ./README.md -RUN pip3 install -U pip -RUN pip3 install poetry==1.2.2 -RUN poetry install --no-dev -E all -RUN poetry cache clear pypi --all --no-interaction +RUN python3.10 -m pip install -U pip +RUN python3.10 -m pip install .[all] -CMD ["poetry", "run", "uvicorn", "--factory", "konoha.api.server:create_app", "--reload", "--host", "0.0.0.0", "--port", "8000"] +CMD [ \ + "python3.10", "-m", "uvicorn", \ + "--factory", "konoha.api.server:create_app", \ + "--reload", "--host", "0.0.0.0", "--port", "8000" \ +]