-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile
114 lines (106 loc) · 4.13 KB
/
Dockerfile
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
FROM debian:bullseye-slim
# Default to UTF-8 file.encoding
ENV LANG C.UTF-8
# Get all packages, install Java OpenJDK 11 and create a user
RUN echo 'Installing SEPIA-Home...' && \
#
# Update package sources
apt-get update && \
#
# Fix for Debian9/10 slim to be able to install Java
mkdir -p /usr/share/man/man1 && \
#
# Get packages
apt install -y --no-install-recommends \
sudo git wget curl nano unzip zip procps \
openjdk-11-jdk-headless ca-certificates-java \
ntpdate nginx \
espeak-ng espeak-ng-espeak libpopt0 && \
#
# Update time-sync - NOTE: not possible in Docker? will use host clock?
# timedatectl set-ntp true
#
# Clean up
apt-get clean && apt-get autoclean && apt-get autoremove -y && \
#
# Create a Linux user
useradd --create-home --shell /bin/bash admin && \
adduser admin sudo && \
echo "admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Set JAVA_HOME path ... just in case - TODO: fix path for ARM or remove
#
# ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
# ENV PATH="${JAVA_HOME}:${PATH}"
#
# Set a Docker ENV to identify container in scripts
ENV ISDOCKER="true"
# Download SEPIA-Home (custom-bundle, single-server, SBC version)
USER admin
RUN echo "Downloading SEPIA-Home (custom bundle) ..." && \
#
# Make target and temporary folder (SEPIA should be in ~/SEPIA)
mkdir -p ~/SEPIA/tmp && \
cd ~/SEPIA/tmp && \
#
# Download files
wget "https://github.com/SEPIA-Framework/sepia-installation-and-setup/releases/latest/download/SEPIA-Home.zip" && \
unzip SEPIA-Home.zip -d ~/SEPIA && \
#
# Clean up
cd ~/SEPIA && \
find . -iname "*.sh" -exec chmod +x {} \; && \
chmod +x elasticsearch/bin/elasticsearch && \
rm -rf ~/SEPIA/tmp && \
#
# Run setup to install TTS engine
bash setup.sh 7 && \
#
# Install non-commercial TTS systems (activate via server settings)
sudo apt install -y git make gcc g++ && \
cd ~/SEPIA/sepia-assist-server/Xtensions/TTS/espeak-ng-mbrola && \
sed -i -e "s|read -p \"Enter 'agree'.*|agreeornot=agree|g" install.sh && \
bash install.sh && \
cd ~/SEPIA/sepia-assist-server/Xtensions/TTS/txt2pho && \
bash install.sh && \
sudo apt remove -y make gcc g++ && \
sudo apt clean && sudo apt autoclean && sudo apt autoremove -y && \
#
# Set up Nginx (HTTP)
cd ~/SEPIA && \
sudo cp nginx/sites-available/sepia-fw-http.conf /etc/nginx/sites-enabled/sepia-fw-http.conf && \
sudo sed -i -e 's|\[my-sepia-path\]|'"/home/admin/SEPIA"'|g' /etc/nginx/sites-enabled/sepia-fw-http.conf && \
sudo unlink /etc/nginx/sites-enabled/default && \
#
# Prepare automatic-setup and user1
cd automatic-setup && \
cp template.yaml config.yaml && \
sed -i '/- answers/d' config.yaml && \
sed -i '/- commands/d' config.yaml && \
sed -i 's/nickname: Testy/nickname: Boss/' config.yaml && \
sed -i 's/email: test@sepia.localhost/email: user1@sepia.localhost/' config.yaml && \
sed -i 's/password: test12345/password: <random>/' config.yaml && \
touch docker-setup && cd .. && \
#
# Set up external data folder
bash scripts/create-external-data-folder.sh -yu
#
# Optional, final modifications imported from build folder:
# ADD *.sh /home/admin/SEPIA/
# RUN cd ~/SEPIA && sudo find . -iname "*.sh" -exec chmod +x {} \;
#
# ---------------------
# Please read: https://github.com/SEPIA-Framework/sepia-docs/wiki/SEPIA-inside-virtual-environments
#
# Set up Elasticsearch
# Run this on your HOST (the machine that starts the Docker container): sudo sysctl -w vm.max_map_count=262144
# Comment: https://www.elastic.co/guide/en/elasticsearch/reference/5.3/vm-max-map-count.html (the container will inherit this from the host)
#
# Set up SEPIA
# NOTE: If the file '$SEPIA_SHARE/setup/automatic-setup/docker-setup' exists the automatic setup will run
# 0 - Create an EMPTY shared folder: SEPIA_SHARE=/home/[my-user]/sepia-home-share && mkdir -p $SEPIA_SHARE
# 1 - Make a Docker volume out of it: docker volume create --opt type=none --opt device=$SEPIA_SHARE --opt o=bind sepia-home-share
# 3 - Run the server: docker run --rm --name=sepia_home -p 20726:20726 -d -v sepia-home-share:/home/admin/sepia-home-data sepia/home:vX.X.X
# ---------------------
# Start
WORKDIR /home/admin/SEPIA
CMD sudo service nginx start && bash on-docker.sh