0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

docker環境構築 mecab && python3 on ubuntu20.04

Last updated at Posted at 2021-05-09

mecabの辞書はipadicです。

File構成

dir/
├ Dockerfile
├ docker-compose.yml
└ requirements.txt

Dockerfile

FROM ubuntu:20.04
USER root

RUN apt update
RUN apt install -y python3-pip
RUN apt -y install  build-essential libssl-dev libffi-dev python3-dev
RUN apt -y install mecab libmecab-dev mecab-utils mecab-ipadic mecab-ipadic-utf8 python3-mecab
RUN apt -y install locales && \
    localedef -f UTF-8 -i ja_JP ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
ENV TZ JST-9
ENV TERM xterm

ADD requirements.txt .

RUN apt-get install -y vim less
RUN apt-get install -y libhdf5-dev
RUN pip3 install --upgrade pip
RUN pip install --upgrade setuptools
RUN pip install -r requirements.txt

requirements.txt

mecab-python
unidic-lite //なくても動く

references

Python 3をインストールしUbuntu 20.04サーバーにプログラミング環境を設定する方法
(https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-programming-environment-on-an-ubuntu-20-04-server-ja)

【Python】形態素解析エンジン MeCabの使い方
(https://hibiki-press.tech/python/mecab/5153)

MeCab のインストール(Ubuntu 上)
(https://www.kkaneko.jp/tools/ubuntu/ubuntu_mecab.html)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?