-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·106 lines (83 loc) · 3.47 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# ----------------------------------------------------------------------- #
# KnowingMe
# File: Dockerfile
# Purpose: Build docker image - Production (Github Code)
# Maintainer: Clara Marquardt
# Last Updated: 2018-01-09
# Language: Python 2.7
# Notes: See the README for instructions on how to build the image
# ------------------------------------------------------------------------ #
# STAGE BASIC
# ------------------------------------------------------------------------ #
# ------------------------------------------------------------------------ #
# Basic Setup (Ubuntu + Core dependencies incl. git, python, pip, postgresql)
# ------------------------------------------------------------------------ #
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install --no-install-recommends --no-install-suggests -y --reinstall build-essential
RUN apt-get install --no-install-recommends --no-install-suggests -y g++-4.8 git bash python python-setuptools \
gcc python-pip libc-dev unixodbc-dev python-dev
RUN pip install --upgrade pip
# Info
# ------------------------------------------------------------------------ #
MAINTAINER Clara Marquardt "marquardt.clara@gmail.com”
RUN pwd
RUN ls root/
# Environment Variables
# ------------------------------------------------------------------------ #
ENV PORT 8000
ENV DEBUG "False"
ENV OFFLINE "False"
ENV TIMEZONE_OFFSET 4
ENV TIMEZONE_NAME "EST"
ENV SAFE_MODE "False"
# Obtain Codebase (From Github)
# ------------------------------------------------------------------------ #
RUN git clone https://5f93c3a742abf9ec98d058391d49cb7970e90973:x-oauth-basic@github.com/ClaraMarquardt/KnowingMeBeta_Test.git
RUN pwd
# Installation
# ------------------------------------------------------------------------ #
# Installation - Setup
# ---------------------------------------------
RUN pwd
WORKDIR /KnowingMeBeta_Test/
RUN chmod -R a+rwx .
# Installation - Python Dependencies
# ---------------------------------------------
## Install Dependencies
RUN pip install --no-binary scipy scikit-learn
RUN pip --no-cache-dir install -r codebase/requirements.txt
RUN pip install --upgrade google-api-python-client
## Test Dependencies
# RUN python codebase/installation/dependency_test.sh
RUN python codebase/installation/nltk_test.py
RUN python codebase/installation/spacy_test.py
# STAGE RESTART
# ------------------------------------------------------------------------ #
# ------------------------------------------------------------------------ #
# Restart
# ---------------------------------------------
ARG RESTART=unknown
RUN RESTART=${RESTART} echo "stage_restart" # comment to restart here
# Reinstall codebase
# ---------------------------------------------
WORKDIR /
RUN pwd
RUN rm -rf /KnowingMeBeta_Test
RUN git clone https://5f93c3a742abf9ec98d058391d49cb7970e90973:x-oauth-basic@github.com/ClaraMarquardt/KnowingMeBeta_Test.git
WORKDIR /KnowingMeBeta_Test/
RUN chmod -R a+rwx .
RUN rm -rf /KnowingMeBeta_Test/.git
RUN rm -rf /KnowingMeBeta_Test/.gitignore
# Create volume
# ---------------------------------------------
RUN mkdir /KnowingMe_Data
RUN chmod -R a+rwx /KnowingMe_Data
# Launch
# ---------------------------------------------
VOLUME /KnowingMe_Data
WORKDIR /KnowingMeBeta_Test/
EXPOSE $PORT
CMD ["/KnowingMeBeta_Test/codebase/docker/docker_start.sh"]
# ------------------------------------------------------------------------ #
# ------------------------------------------------------------------------ #