-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile
49 lines (41 loc) · 1.37 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 \
wget \
mecab \
libmecab-dev \
mecab-ipadic-utf8 \
python3.10 \
python3.10-dev \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
# kytea
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 \
&& patch -p1 < ../24.patch \
&& ./configure && make && make install && ldconfig -v \
&& cd .. && rm -rf kytea-0.4.7.tar.gz kytea-0.4.7
WORKDIR /work
COPY ./data ./data
COPY ./src ./src
COPY ./pyproject.toml ./pyproject.toml
COPY ./requirements.lock ./requirements.lock
COPY ./README.md ./README.md
RUN python3.10 -m pip install -U pip
RUN python3.10 -m pip install -r requirements.lock
RUN python3.10 -m pip install .
CMD [ \
"python3.10", "-m", "uvicorn", \
"--factory", "konoha.api.server:create_app", \
"--reload", "--host", "0.0.0.0", "--port", "8000" \
]