Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Create Dockerfile #103

wants to merge 1 commit into from

Conversation

lsetiawan
Copy link
Member

@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.

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.
@lsetiawan lsetiawan closed this Feb 2, 2017
@lsetiawan lsetiawan deleted the patch-4 branch February 2, 2017 19:09
@lsetiawan lsetiawan restored the patch-4 branch February 2, 2017 19:23
@lsetiawan lsetiawan reopened this Feb 2, 2017
@miguelcleon
Copy link
Member

Thanks, I will give it a try tomorrow.

@@ -0,0 +1,52 @@
FROM ubuntu:14.04
Copy link
Member

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 && \
Copy link
Member

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 && \
Copy link
Member

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"
Copy link
Member

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"]
Copy link
Member

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

Copy link
Member

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

@ocefpaf
Copy link
Member

ocefpaf commented Feb 2, 2017

Ultimately this will be a non-interactive image, where someone could do:

docker run -d -p 8000:8000 -v /your/local/folder/for/sqlite/database:/srv/your/image/folder/for/sqlite/database/db/ image_name

and then open the browser at localhost 8000

@lsetiawan
Copy link
Member Author

@ocefpaf Thanks for the input. I will try to develop this some more.

@miguelcleon
Copy link
Member

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.

@miguelcleon
Copy link
Member

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:

conda config --add channels conda-forge --force
conda create -n ENVNAME python=2.7 --file requirements.txt --file requirements-dev.txt

or you can do all in one command with:
conda create -n ENVNAME python=2.7 --file requirements.txt --file requirements-dev.txt -c conda-forge

@miguelcleon
Copy link
Member

@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.

@miguelcleon
Copy link
Member

@lsetiawan on the suggestion of @emiliom I thought I'd ping you about the feedback I left here about the dockfile.

@lsetiawan
Copy link
Member Author

Here's the progress I have so far: https://github.com/miguelcleon/ODM2-Admin/issues/107

@lsetiawan
Copy link
Member Author

I am closing this one and will open a new one with an updated Dockerfile.

@lsetiawan lsetiawan closed this Apr 7, 2017
@lsetiawan lsetiawan deleted the patch-4 branch August 11, 2017 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants