Skip to content

Commit

Permalink
chore: update Dockerfile (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
himkt authored Jan 13, 2024
1 parent 16a9c99 commit 4a5a33d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/*

Expand All @@ -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

Expand All @@ -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" \
]

0 comments on commit 4a5a33d

Please sign in to comment.