-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
31 lines (22 loc) · 860 Bytes
/
build.sh
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
#!/bin/sh
# Build the container using buildah instead of Docker
# Retrieve container
CONTAINER=$(buildah from centos:centos7)
echo $CONTAINER
# Mount the container filesystem
MNT=$(buildah mount $CONTAINER)
echo $MNT
# Install python3 within the container path
yum --assumeyes install --installroot $MNT python3
# Install python libraries within the container path
pip3 install --prefix=$MNT/usr/ Flask flask-cors nltk pyyaml requests uwsgi
# Remove unnecessary cache files
rm -rf $MNT/var/cache $MNT/var/log/*
# Copy chatbot app files
cp chatbot.py $MNT/
cp chat.html $MNT/
# Set container config options (port, entrypoint)
buildah config --port 9500/tcp $CONTAINER
buildah config --entrypoint 'uwsgi --http :9500 --manage-script-name --mount /=chatbot:app' $CONTAINER
# Commit the changes to nltk-eliza
buildah commit $CONTAINER cherdt/nltk-chatbot