-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
95 lines (79 loc) · 2.82 KB
/
dockerfile
File metadata and controls
95 lines (79 loc) · 2.82 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Step 1: Use an official Python runtime as a parent image
FROM python:3.9-slim
# Step 2: Set the working directory inside the container
WORKDIR /app
# Step 3: Install necessary dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
build-essential \
libpq-dev \
python3-dev \
g++ \
automake \
autoconf \
unzip \
wget \
mecab \
mecab-ipadic-utf8 \
pkg-config \
default-libmysqlclient-dev \
libmecab-dev \
swig \
sudo
# Step 4: Install konlpy
RUN git clone --depth 1 https://github.com/konlpy/konlpy.git && \
cd konlpy && \
python3 setup.py install && \
cd .. && \
rm -rf konlpy
# Step 5: Download and update config.guess and config.sub
RUN wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' && \
wget -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
# Step 6: Install mecab-ko
RUN wget https://bitbucket.org/eunjeon/mecab-ko/downloads/mecab-0.996-ko-0.9.2.tar.gz && \
tar zxfv mecab-0.996-ko-0.9.2.tar.gz && \
cd mecab-0.996-ko-0.9.2 && \
cp /app/config.guess /app/config.sub . && \
./configure && \
make && \
make install && \
cd .. && \
rm -rf mecab-0.996-ko-0.9.2 mecab-0.996-ko-0.9.2.tar.gz
# Step 7: Install mecab-ko-dic
RUN wget https://bitbucket.org/eunjeon/mecab-ko-dic/downloads/mecab-ko-dic-2.1.1-20180720.tar.gz && \
tar zxfv mecab-ko-dic-2.1.1-20180720.tar.gz && \
cd mecab-ko-dic-2.1.1-20180720 && \
./autogen.sh && \
./configure && \
make && \
sudo make install && \
cd .. && \
rm -rf mecab-ko-dic-2.1.1-20180720 mecab-ko-dic-2.1.1-20180720.tar.gz
# Step 8: Clone the py-hanspell repository
RUN git clone https://github.com/ssut/py-hanspell.git
# Step 9: Copy the modified spell_checker.py into the container
COPY spell_checker.py /app/py-hanspell/hanspell/spell_checker.py
# Step 10: Install py-hanspell
WORKDIR /app/py-hanspell
RUN pip install setuptools
RUN python setup.py install
# Step 11: Install Mecab-ko-for-Google-Colab
WORKDIR /app
RUN git clone https://github.com/SOMJANG/Mecab-ko-for-Google-Colab.git
WORKDIR /app/Mecab-ko-for-Google-Colab
RUN bash install_mecab-ko_on_colab_light_220429.sh
# Step 12: Copy the requirements file and install dependencies
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Step 13: Copy the rest of the application code
COPY . .
# Step 14: Set the working directory to the location of main.py
WORKDIR /app/projects/bubblow
# Step 15: Set the PYTHONPATH environment variable
ENV PYTHONPATH="/app:/app/projects:/app/projects/nt-worker"
# Step 16: Expose port 8000
EXPOSE 8000
# Step 17: Command to run the FastAPI app with Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]