Dockerfile 2.99 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
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
#
# 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

# Add sudo
RUN yum install -y sudo
RUN groupadd sudo
RUN cat /etc/group

# 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"
RUN find /home/partemix/anaconda3 -name "conda"
# Updating Anaconda packages
RUN conda update conda
RUN conda update anaconda
RUN conda update --all

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

# Create some directories expected by the application.

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

# 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

# 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.
82
83
84
85
COPY ./serverWsgi.michel*.py /home/partemix/yafitss/
COPY ./dataManager_michel*.py /home/partemix/yafitss/
COPY ./DataBlock.py /home/partemix/yafitss/
COPY ./requirements.txt /home/partemix/yafitss/
Caillat Michel's avatar
Caillat Michel committed
86
87
88
89

# python modules required by yafitss have to be installed
RUN pip install -r /home/partemix/yafitss/requirements.txt

90
91
# ./yafitss/serverWsgi.michel will be listening at 4251
EXPOSE 4251