Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update Dockerfile #190

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" \
]
Loading