Dockerfile 2.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# DOCKERi skript
#   OMA TEENUSE ettevalmistamisel asenda nii käesolevas failis kui ka failis README.MD string 'kl_teenus' sobiva nimega, 
#   näiteks sõnade loendaja 'wc' korral 'kl_wc'.
#   Nimed 'github.com' ja 'username' tuleb asendada vastavalt kasutatavale GIT repositooriumile.
#
# DOCKERi paigaldamiseks ja käivitamiseks:
#   cd /soovitud/asukoht/oma/teenuse/koodile/serveris
#   wget https://github.com/username/kl_teenus/raw/master/Dockerfile
#   docker build -t kl_teenus .
#   docker run --name kl_redis --rm --restart=no redis
#   docker run --name kl_teenus -d --link kl_redis:redis -p 3003:3003 -v /etc/wrapper/teenus/:/config kl_teenus
#
# DOCKERi seiskamiseks:
#   docker kill kl_teenus
#   docker rm kl_teenus
#

FROM    debian:jessie

# Kui Debianil pole vaikimisi kaasas GCC vajalikke teeke vms, siis tuleb need ka lasta installida.

Indrek Jentson's avatar
Indrek Jentson committed
22
23
RUN echo "Default utilities install" && \
    apt-get update && \
Indrek Jentson's avatar
Indrek Jentson committed
24
    apt-get -y install curl sudo pkg-config && \
25
    curl -sL https://deb.nodesource.com/setup | sudo bash - && \
Indrek Jentson's avatar
Indrek Jentson committed
26
    apt-get -y install build-essential nodejs wget gawk && \
Indrek Jentson's avatar
Indrek Jentson committed
27
    apt-get -y install git && echo "Default utilities installed"
28
29
30
31
32

RUN npm install -g forever

# Valmistame ette koodi, mida me DOCKERis kasutama hakkame. Siinkohal peaks plaanima, et mis failid kus kataloogis peaks olema

Indrek Jentson's avatar
Indrek Jentson committed
33
34
RUN echo "Wrapper install" && \
mkdir -p /wrapper && mkdir -p /config && mkdir -p /wrapper/files && mkdir -p /wrapper/tmp && mkdir -p /wrapper/logs && \
35
cd /wrapper && \
Indrek Jentson's avatar
Indrek Jentson committed
36
git clone 'https://gitlab.keeleressursid.ee/keeleliin/keeleliin-wrapper.git' && \
37
38
mv keeleliin-wrapper/* . && \
mv keeleliin-wrapper/.g* . && \
39
npm install && \
Indrek Jentson's avatar
Indrek Jentson committed
40
echo "Wrapper and NPM installed"
41
42
43
44

# SIIA ALLA lisa kõik installeerimise käsud, mis on vajalikud sisulist tööd tegeva tarkvara X paigaldamiseks.
# Tarkvara X paigaldamine algab 

Indrek Jentson's avatar
Indrek Jentson committed
45
46
RUN "Specific utilities install" && \
cd /wrapper && \
Indrek Jentson's avatar
Indrek Jentson committed
47
git clone 'https://gitlab.keeleressursid.ee/keeleliin/kl-morph-analyser.git' && \
Indrek Jentson's avatar
Indrek Jentson committed
48
49
cp kl-morph-analyser/config_dist.js . && \
cp kl-morph-analyser/command.sh . && \
Indrek Jentson's avatar
Indrek Jentson committed
50
51
52
53
chmod +x command.sh && \
git clone 'https://github.com/Filosoft/vabamorf.git' && \
cd vabamorf/apps/cmdline/project/unix && \
make -f Makefile.etana && \
Indrek Jentson's avatar
Indrek Jentson committed
54
cd /wrapper/vabamorf && \
Indrek Jentson's avatar
Indrek Jentson committed
55
56
57
JUUR=$(pwd) && \
cd ${JUUR}/dct/sh && \
chmod +x *.sh && \
Indrek Jentson's avatar
Indrek Jentson committed
58
./nullist-uus-sonastik.sh && \
Indrek Jentson's avatar
Indrek Jentson committed
59
cd /wrapper && \
Indrek Jentson's avatar
Indrek Jentson committed
60
git clone 'https://github.com/EstSyntax/EstCG.git'
61
62
63

# Tarkvara X paigaldamine lõppeb

64
# Expose port
Indrek Jentson's avatar
Indrek Jentson committed
65
EXPOSE  3011
66
67

VOLUME ["/config"]
Indrek Jentson's avatar
Indrek Jentson committed
68
VOLUME ["/wrapper/logs"]
69

70
CMD cd /wrapper && ./docker_start.sh