-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-jimi_web
36 lines (28 loc) · 1.29 KB
/
Dockerfile-jimi_web
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
# Build from ubuntu
FROM ubuntu:latest
# Install requirements
RUN apt-get update && apt-get install -y --no-install-recommends python3-minimal python3-venv python3-pip python3-setuptools python3-wheel git unzip wget ca-certificates && rm -rf /var/lib/apt/lists/*
# Create and change user to jimi
RUN useradd jimi && mkdir /home/jimi && chown jimi:jimi /home/jimi
USER jimi
# Transfer jimi system files
WORKDIR /home/jimi/
RUN git clone https://github.com/z1pti3/jimi.git jimi
# Building python venv
ENV VIRTUAL_ENV=/home/jimi/venv
RUN python3 -m venv venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Installing core requirements
RUN pip install wheel && pip install -r jimi/requirements.txt
# Install jimi stable plugin requirements
RUN pip3 install numpy
RUN pip3 install matplotlib
RUN pip3 install sklearn
RUN pip install paramiko pywinrm smbprotocol scp sshtunnel pythonping
RUN pip install pip install gunicorn
WORKDIR /home/jimi/jimi/
RUN head jimi_web.py -n -4 > jimi_web2.py && rm jimi_web.py && mv jimi_web2.py jimi_web.py
RUN echo "from jimi_web import api\n\napplication = api.webServer\n\nif __name__ == '__main__':\n\tapplication.run()" > start.py
RUN echo "gunicorn --bind 0.0.0.0:4443 --workers 4 --threads 10 --certfile=data/web.cert --key=data/web.key start" > start_web.sh
# Run
CMD ["bash", "start_web.sh"]