-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (33 loc) · 1.63 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
# HydroShare Data Services 1.0.0
# Django 3.0.1
FROM ubuntu:18.04
MAINTAINER Kenneth Lippold [email protected]
# Apt Setup ----------------------------------------------------------------------------------------------#
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install wget vim sudo supervisor -y
# Create dsuser user --------------------------------------------------------------------------------------#
RUN adduser --disabled-password --gecos '' dsuser
RUN adduser dsuser sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER dsuser
ENV DS_HOME /home/dsuser
WORKDIR $DS_HOME
RUN chmod a+rwx $DS_HOME
# Setup Conda Environment --------------------------------------------------------------------------------#
RUN wget https://repo.continuum.io/miniconda/Miniconda2-4.5.12-Linux-x86_64.sh
RUN bash Miniconda2-4.5.12-Linux-x86_64.sh -b
RUN rm Miniconda2-4.5.12-Linux-x86_64.sh
ENV PATH /home/dsuser/miniconda2/bin:$PATH
RUN conda update conda
COPY hs_data_services/environment.yml $DS_HOME/hs_data_services/environment.yml
RUN sudo chown -R dsuser $DS_HOME/hs_data_services
RUN conda env create -f $DS_HOME/hs_data_services/environment.yml
# Place Application Files --------------------------------------------------------------------------------#
COPY hs_data_services/ $DS_HOME/hs_data_services
COPY conf/ $DS_HOME/conf
RUN sudo chmod -R +x $DS_HOME/conf
RUN sudo chown -R dsuser $DS_HOME/hs_data_services
RUN sudo chown -R dsuser $DS_HOME/conf
# Activate Conda Environment -----------------------------------------------------------------------------#
RUN echo "source activate hs_data_services" > ~/.bashrc