mirror of
https://github.com/syuilo/ai.git
synced 2025-03-25 21:12:56 +00:00
DockerでMeCabのインストールの有無を切り替えられるようにする
This commit is contained in:
parent
e77d9c8060
commit
a61271de92
2 changed files with 13 additions and 8 deletions
16
Dockerfile
16
Dockerfile
|
@ -1,13 +1,10 @@
|
||||||
FROM node:lts-bullseye
|
FROM node:lts-bullseye
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y tini
|
RUN apt-get update && apt-get install -y tini
|
||||||
|
|
||||||
COPY . /ai
|
ARG enable_mecab=1
|
||||||
|
|
||||||
WORKDIR /ai
|
RUN if [ $enable_mecab -ne 0 ]; then apt-get update \
|
||||||
RUN npm install && npm run build
|
|
||||||
|
|
||||||
# install mecab and neologd
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install mecab libmecab-dev mecab-ipadic-utf8 make curl xz-utils file sudo --no-install-recommends -y \
|
&& apt-get install mecab libmecab-dev mecab-ipadic-utf8 make curl xz-utils file sudo --no-install-recommends -y \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt-get/lists/* \
|
&& rm -rf /var/lib/apt-get/lists/* \
|
||||||
|
@ -17,7 +14,12 @@ RUN apt-get update \
|
||||||
&& ./bin/install-mecab-ipadic-neologd -n -y \
|
&& ./bin/install-mecab-ipadic-neologd -n -y \
|
||||||
&& rm -rf /opt/mecab-ipadic-neologd \
|
&& rm -rf /opt/mecab-ipadic-neologd \
|
||||||
&& echo "dicdir = /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/" > /etc/mecabrc \
|
&& echo "dicdir = /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/" > /etc/mecabrc \
|
||||||
&& apt-get purge git make curl xz-utils file -y
|
&& apt-get purge git make curl xz-utils file -y; fi
|
||||||
|
|
||||||
|
COPY . /ai
|
||||||
|
|
||||||
|
WORKDIR /ai
|
||||||
|
RUN npm install && npm run build
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||||||
CMD npm start
|
CMD npm start
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
- enable_mecab=1
|
||||||
volumes:
|
volumes:
|
||||||
- './config.json:/ai/config.json:ro'
|
- './config.json:/ai/config.json:ro'
|
||||||
- './font.ttf:/ai/font.ttf:ro'
|
- './font.ttf:/ai/font.ttf:ro'
|
||||||
|
|
Loading…
Reference in a new issue