-
Notifications
You must be signed in to change notification settings - Fork 356
/
Dockerfile
70 lines (51 loc) · 2.22 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
61
62
63
64
65
66
67
68
69
FROM python:3.6
MAINTAINER Rob Speer <rob@luminoso.com>
# The ConceptNet package and its dependencies
# -------------------------------------------
# Configure the environment where ConceptNet will be built
ENV PYTHON python3
# Install system dependencies (the overall form of this command is recommended by https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/)
RUN apt-get update \
&& apt-get install -y build-essential python3-pip libatlas-dev liblapack-dev libhdf5-dev libmecab-dev mecab-ipadic-utf8 nginx supervisor \
&& rm -rf /var/lib/apt/lists/*
ADD conceptnet5 /src/conceptnet/conceptnet5
ADD tests /src/conceptnet/tests
ADD scripts /src/conceptnet/scripts
ADD testdata /src/conceptnet/testdata
ADD setup.py /src/conceptnet/setup.py
ADD Snakefile /src/conceptnet/Snakefile
# Set up ConceptNet, with optional dependencies for conceptnet5.vectors
WORKDIR /src/conceptnet
RUN pip install -e '.[vectors]'
# This is where the data should go, but you have to put it there using
# a Docker volume
ENV CONCEPTNET_DATA /conceptnet_data
# The ConceptNet web server
# -------------------------
## This stuff comes from tiangolo/uwsgi-nginx-docker:
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
EXPOSE 80 443
# Set up uwsgi
RUN pip install uwsgi
# Make NGINX run on the foreground
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
# Copy the modified Nginx conf
COPY web/server/nginx.conf /etc/nginx/conf.d/
# Copy the base uWSGI ini file to enable default dynamic uwsgi process number
COPY web/server/uwsgi.ini /etc/uwsgi/
COPY web/server/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN rm /etc/nginx/sites-enabled/default
## End of tiangolo/uwsgi-nginx-docker
RUN mkdir -p /data/nginx/cache
RUN mkdir -p /data/nginx/tmp
# Set up the local code
ADD web/conceptnet_web /src/conceptnet-web/conceptnet_web
ADD web/templates /src/conceptnet-web/templates
ADD web/setup.py /src/conceptnet-web/setup.py
ADD web/static /var/www/static
WORKDIR /src/conceptnet-web
RUN pip install -e '.'
# Run the web server via its supervisor configuration
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]