mirror of
https://github.com/syuilo/ai.git
synced 2024-11-23 13:38:00 +00:00
465b4312dc
* fix(process): 何か失敗してもクラッシュしないように * fix(upload): ファイルのアップロードができない問題を修正 * fix(docker): ビルドできるように
26 lines
917 B
Docker
26 lines
917 B
Docker
FROM node:lts
|
|
|
|
RUN apt-get update && apt-get install tini --no-install-recommends -y && apt-get clean && rm -rf /var/lib/apt-get/lists/*
|
|
|
|
ARG enable_mecab=1
|
|
|
|
RUN if [ $enable_mecab -ne 0 ]; then apt-get update \
|
|
&& apt-get install mecab libmecab-dev mecab-ipadic-utf8 make curl xz-utils file sudo --no-install-recommends -y \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt-get/lists/* \
|
|
&& cd /opt \
|
|
&& git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git \
|
|
&& cd /opt/mecab-ipadic-neologd \
|
|
&& ./bin/install-mecab-ipadic-neologd -n -y \
|
|
&& rm -rf /opt/mecab-ipadic-neologd \
|
|
&& 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; fi
|
|
|
|
COPY . /ai
|
|
|
|
WORKDIR /ai
|
|
RUN npm install && npm run build || test -f ./built/index.js
|
|
|
|
ENTRYPOINT ["/usr/bin/tini", "--"]
|
|
CMD npm start
|