Dockerfile 4.18 KB
Newer Older
Caillat Michel's avatar
Caillat Michel committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#
# Adapted from the tutorial found at
# http://www.science.smith.edu/dftwiki/index.php/Tutorial:_Docker_Anaconda_Python_--_4
#
# Michel Caillat - 6 Mai 2019
#

#------------------------------------------------------------#
#                                                            #
#                  General required stuff                    #
#                                                            #
#------------------------------------------------------------#

# We will use Centos for our image
FROM centos:latest

# Updating Ubuntu packages
RUN yum install -y emacs

# Adding wget and bzip2
RUN yum install -y wget bzip2

23
24
25
26
# Install tcl stuff
RUN yum install -y tcl
RUN yum install -y tcl-devel

Caillat Michel's avatar
Caillat Michel committed
27
28
29
30
31
# Add sudo
RUN yum install -y sudo
RUN groupadd sudo
RUN cat /etc/group

32
33
34
35
36
37
38
39
# Installing nodejs
RUN yum -y install curl
RUN curl --silent --location https://rpm.nodesource.com/setup_9.x |sudo bash -
RUN yum -y install nodejs

#Install apidoc
RUN npm install -g apidoc

Caillat Michel's avatar
Caillat Michel committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Add user partemix with no password, add to sudo group
RUN adduser -G sudo -d /home/partemix  partemix
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN ls /home/partemix

# Player is partemix
USER partemix
WORKDIR /home/partemix/
RUN chmod a+rwx /home/partemix/

# Anaconda installing
RUN wget https://repo.continuum.io/archive/Anaconda3-2019.03-Linux-x86_64.sh
RUN bash Anaconda3-2019.03-Linux-x86_64.sh -b
RUN rm Anaconda3-2019.03-Linux-x86_64.sh

# Set path to conda
ENV PATH /home/partemix/anaconda3/bin:$PATH

RUN pwd
RUN echo "PATH=$PATH"
60
#RUN find /home/partemix/anaconda3 -name "conda"
Caillat Michel's avatar
Caillat Michel committed
61
# Updating Anaconda packages
62
63
64
# RUN conda update conda
# RUN conda update anaconda
# RUN conda update --all
Caillat Michel's avatar
Caillat Michel committed
65
66
67
68
69
70
71
72

#------------------------------------------------------------#
#                                                            #
#               partemix related stuff                       #
#                                                            #
#------------------------------------------------------------#

# Create some directories expected by the application.
73
74
75
76
77
ARG YAFITS_FITSDIR
ARG YAFITS_FITSDIR2

ENV YAFITS_FITSDIR=$YAFITS_FITSDIR
ENV YAFITS_FITSDIR2=$YAFITS_FITSDIR2
Caillat Michel's avatar
Caillat Michel committed
78
79

# The root directory of the FITS files location (readonly). It'll have to be bound to an host directory.
80
81
82
83
84
85
86
RUN printenv
RUN sudo mkdir -p ${YAFITS_FITSDIR}
RUN sudo chown partemix:partemix ${YAFITS_FITSDIR}

# The first extension to the root directory of FITS files location (readonly). It'll have to be bound to an host directory.
RUN sudo mkdir -p ${YAFITS_FITSDIR2}
RUN sudo chown partemix:partemix ${YAFITS_FITSDIR2}
Caillat Michel's avatar
Caillat Michel committed
87
88
89
90

# The root directory of the PNG files (read/write). It'll have to be bound to an host directory.
RUN mkdir -p /home/partemix/dataroot/PNG

91
92
93
# The root directory of the yt Obj files (read/write). It'll have to be bound to an host directory.
RUN mkdir -p /home/partemix/dataroot/OBJ

94
95
96
# The root directory of the ApiDoc files (read/write).
RUN mkdir -p /home/partemix/dataroot/apidoc

Caillat Michel's avatar
Caillat Michel committed
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# The directory for log files (read/write). It'll have to be bound to an host directory.
RUN mkdir /home/partemix/log


#------------------------------------------------------------#
#                                                            #
#                yafitss related stuff                       #
#                                                            #
#------------------------------------------------------------#

# The directory where the python FITS files server will reside.
RUN mkdir -p /home/partemix/yafitss

# Put the application files and module requirements in place.
111
COPY ./serverWsgi.py /home/partemix/yafitss/
112
113
114
COPY ./dataManager_michel*.py /home/partemix/yafitss/
COPY ./DataBlock.py /home/partemix/yafitss/
COPY ./requirements.txt /home/partemix/yafitss/
115
COPY ./apidoc.json /home/partemix/yafitss/
Caillat Michel's avatar
Caillat Michel committed
116
117
118

# python modules required by yafitss have to be installed
RUN pip install -r /home/partemix/yafitss/requirements.txt
119
120
RUN pip install yt
RUN pip install spectral-cube
Caillat Michel's avatar
Caillat Michel committed
121

122
123
124
125
# Generate the bottle server documentation
RUN ls -l /home/partemix/anaconda3/pkgs/matplotlib-3.0.3-py37h5429711_0/lib/
# RUN apidoc -f /home/partemix/yafitss/serverWsgi.py -c /home/partemix/yafitss/ -o /home/partemix/dataroot/apidoc

126
127
# ./yafitss/serverWsgi.michel will be listening at 4251
EXPOSE 4251