-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
52 lines (39 loc) · 1.85 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
################################
## YodaQA Label Service Image ##
################################
# Proposed image name: label-service
# Inherit Debian image
FROM debian:jessie
# Update and install dependencies [cmp. https://docs.docker.com/engine/articles/dockerfile_best-practices/]
RUN apt-get update && apt-get install -y \
curl \
git \
pypy
# Set the locale
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
RUN git clone https://github.com/brmson/label-lookup.git
# If we were to copy label-service files into image
#ADD ./label-service /label-service
RUN cd label-lookup
RUN curl -O https://bootstrap.pypa.io/get-pip.py
# If you run this on an actual system instead of a container: The following 3 commands need root privileges
RUN pypy get-pip.py
RUN mv /usr/local/bin/pip ./pypy_pip
RUN ./pypy_pip install flask SPARQLWrapper
# Same as "export TERM=dumb"; prevents error "Could not open terminal for stdout: $TERM not set"
ENV TERM dumb
# Define working directory
WORKDIR /label-lookup
# Expose port
EXPOSE 5000
EXPOSE 5001
##########
# BEWARE #####################################################################################
# With SELinux you need to run chcon -Rt svirt_sandbox_file_t /home/<user>/docker/docker_shared/
##############################################################################################
# Can be built with: "docker build -t labels ."
# docker run -it -v /home/fp/docker/data/labels/:/shared --entrypoint="pypy" -p 5000:5000 labels /label-lookup/lookup-service.py /shared/sorted_list.dat
# docker run -it -v /home/fp/docker/data/labels/:/shared --entrypoint="pypy" -p 5001:5001 labels /label-lookup/lookup-service-sqlite.py /shared/labels.db
# RUN pypy lookup-service.py /shared/sorted_list.dat is done in run command; need to map sorted_list.dat as volume (read-only)
# Can be used as usual: curl 127.0.0.1:5000/search/AlbaniaPeople