-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
53 lines (42 loc) · 1.52 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
FROM ubuntu:18.04
# Setting locales
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y locales \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
# Install software-properties-common (needed to do apt-add-repository)
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common
# Add repository for swipl
RUN apt-add-repository ppa:swi-prolog/stable
# Install stuff
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
curl \
swi-prolog
# Make microservice directories
RUN mkdir -p /ms/reasoning /ms/reasoning/static /ms/reasoning/templates /ms/reasoning/uploads
# Copy flask stuff
COPY static/. /ms/reasoning/static/
COPY templates/. /ms/reasoning/templates/
COPY reasoning-task.py requirements.txt /ms/reasoning/
# Copy reasoning stuff
RUN mkdir -p /opt/cturtle-1.0.6 /opt/carl-1.0.3 /opt/eye
COPY reasoner/carl-1.0.3/. /opt/cturtle-1.0.6/
COPY reasoner/cturtle-1.0.6/. /opt/cturtle-1.0.6/
COPY reasoner/eye/. /opt/eye/
# Add path environment variables for cturtle and carl
ENV PATH "$PATH:/opt/cturtle-1.0.6"
ENV PATH "$PATH:/opt/carl-1.0.3"
# Set wd
WORKDIR /ms/reasoning
# Setup flask microservice
RUN pip3 install setuptools
RUN pip3 install --no-cache-dir -r requirements.txt
RUN pip3 install --upgrade lxml
# Run microservice
CMD [ "python3", "reasoning-task.py" ]