This repository has been archived by the owner on Oct 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
executable file
·61 lines (46 loc) · 1.56 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
FROM golang:1.11.1-stretch
# Config Environment Variable
ENV TINI_VERSION v0.13.0
# # Setup custom GO Environment Variable (comment to use the default)
# ENV GOPATH /go
ENV GOROOT /usr/local/go
RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y git wget curl
# Add Python stuff
RUN apt-get install -y python3 python3-dev python3-pip python3-scipy python3-numpy && \
python3 -m pip install scikit-learn
# Install SVM
WORKDIR "/tmp"
RUN wget http://www.csie.ntu.edu.tw/~cjlin/cgi-bin/libsvm.cgi?+http://www.csie.ntu.edu.tw/~cjlin/libsvm+tar.gz -O libsvm.tar.gz && \
tar -xvzf libsvm.tar.gz && \
mv libsvm-*/* ./ && \
make && \
cp svm-scale /usr/local/bin/ && \
cp svm-predict /usr/local/bin/ && \
cp svm-train /usr/local/bin/ && \
rm -rf *
# Install mosquitto
RUN apt-get update && apt-get install -y apt-transport-https mosquitto-clients mosquitto
# Install Parsin to GOPATH/src
WORKDIR $GOPATH/src/ParsinServer/
ADD . .
RUN go get ./... && \
go build && \
echo "\ninclude_dir /code/mosquitto" >> /etc/mosquitto/mosquitto.conf
# # Setup supervisor
# RUN apt-get update && \
# apt-get install -y supervisor
# # Add supervisor
# ADD ./configs/supervisord.conf /etc/supervisor/conf.d/
# # Add Tini
# ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
# RUN chmod +x /tini
# ENTRYPOINT ["/tini", "--"]
# # Startup
# CMD ["/usr/bin/supervisord"]
# Expose the ports
Expose 8003/tcp
Expose 1883/tcp
# Run the server
ENTRYPOINT ["/go/src/ParsinServer/ParsinServer"]