-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Dockerfile #103
Create Dockerfile #103
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
FROM ubuntu:14.04 | ||
|
||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 | ||
|
||
LABEL description='Django admin app for Observation Data Model 2 (ODM2)' \ | ||
url='https://github.com/miguelcleon/ODM2-Admin' \ | ||
author='Miguel Leon' \ | ||
author_email='leonmi@sas.upenn.edu' \ | ||
development_status='5 - Production/Stable' \ | ||
environment='Console' \ | ||
intended_audience='Science/Research, Developers, Education' \ | ||
license='MIT License' \ | ||
operating_system='OS Independent' \ | ||
programming_language='Python' \ | ||
topic='Scientific/Engineering, Education' | ||
|
||
EXPOSE 8000 | ||
EXPOSE 5432 | ||
|
||
# Setting up Miniconda | ||
RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \ | ||
libglib2.0-0 libxext6 libsm6 libxrender1 \ | ||
git mercurial subversion \ | ||
nano curl tar | ||
|
||
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \ | ||
wget --quiet https://repo.continuum.io/miniconda/Miniconda2-4.1.11-Linux-x86_64.sh -O ~/miniconda.sh && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I would used the latest link instead of a version and update conda here in the dockerfile. |
||
/bin/bash ~/miniconda.sh -b -p /opt/conda && \ | ||
rm ~/miniconda.sh | ||
|
||
RUN apt-get install -y curl grep sed dpkg && \ | ||
TINI_VERSION=`curl https://github.com/krallin/tini/releases/latest | grep -o "/v.*\"" | sed 's:^..\(.*\).$:\1:'` && \ | ||
curl -L "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.deb" > tini.deb && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious, why do you need this? |
||
dpkg -i tini.deb && \ | ||
rm tini.deb && \ | ||
apt-get clean | ||
|
||
ENV PATH /opt/conda/bin:$PATH | ||
|
||
# Setting up postgresql database | ||
RUN apt-get update --fix-missing && apt-get install -y postgresql postgresql-contrib postgis postgresql-9.3-postgis-2.1 | ||
|
||
RUN git clone "https://github.com/miguelcleon/ODM2-Admin" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here you may want to get a specific version instead of latest |
||
|
||
RUN service postgresql start && sudo -u postgres createdb odm2_db && \ | ||
sudo -u postgres pg_restore -d odm2_db -1 -v "/ODM2-Admin/ODM2AdminExamplePostgresqlDB" && \ | ||
sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'test';" | ||
|
||
# creates an env with the depepencies | ||
RUN conda create --yes -n odm2adminenv python=2.7 --file /ODM2-Admin/requirements.txt | ||
|
||
CMD ["/bin/bash"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may need to issue a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't we want to activate the environment here? Then run this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ubuntu is fine but I would research the smallest image available that already have what you need to run odm2adim.