-
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
Conversation
I don't have much experience creating Dockerfile, this is what I have so far, it basically just creates the image then goes into the shell.
Thanks, I will give it a try tomorrow. |
@@ -0,0 +1,52 @@ | |||
FROM ubuntu:14.04 |
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.
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 comment
The 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.
Conda is a evolving fast and it is nice to always test/run against the latest version.
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why do you need this?
# 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Here you may want to get a specific version instead of latest master
. (Unless the goal is testing and not shipping.)
# 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 comment
The reason will be displayed to describe this comment to others. Learn more.
You may need to issue a ENV DJANGO_SETTINGS_MODULE something.odm2adim.here
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.
wouldn't we want to activate the environment here? Then run this?
python /ODM2-Admin/manage.py runserver
Ultimately this will be a non-interactive image, where someone could do:
and then open the browser at localhost 8000 |
@ocefpaf Thanks for the input. I will try to develop this some more. |
I'm trying this out on a fresh Ubuntu 16.04 installation. At the moment it is failing on database creation of a Django table django_admin_log I'm clearing the table and trying again. |
I'm getting this same problem https://github.com/miguelcleon/ODM2-Admin/issues/97#issuecomment-277282571 looks like the dockerfile should add the conda-forge channel:
or you can do all in one command with: |
@ocefpaf > docker run -d -p 8000:8000 -v /your/local/folder/for/sqlite/database:/srv/your/image/folder/for/sqlite/database/db/ image_name Why is sqlite referenced? @lsetiawan is installing postgresql and starting the sample db. I would think this would start the django webserver on localhost:8000 using the sample db. |
@lsetiawan on the suggestion of @emiliom I thought I'd ping you about the feedback I left here about the dockfile. |
Here's the progress I have so far: https://github.com/miguelcleon/ODM2-Admin/issues/107 |
I am closing this one and will open a new one with an updated Dockerfile. |
@ocefpaf @miguelcleon I don't have much experience creating Dockerfile, this is what I have so far, it basically just creates the image then goes into the shell.