Skip to content

Commit

Permalink
Merge pull request #124 from lsetiawan/docker_dev
Browse files Browse the repository at this point in the history
Fixed errors when building Docker Image & update README
  • Loading branch information
Miguel Leon authored Apr 24, 2017
2 parents 92da1bb + 78223fd commit d6b1628
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM miniconda:latest
FROM continuumio/miniconda:latest

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8

Expand All @@ -22,7 +22,7 @@ VOLUME /db
# Setting up postgresql database
RUN apt-get update --fix-missing && apt-get install -y postgresql postgresql-client postgresql-contrib postgis

RUN git clone "https://github.com/lsetiawan/ODM2-Admin"
RUN git clone "https://github.com/miguelcleon/ODM2-Admin"

RUN cd ODM2-Admin && latest=$(git describe --tags) && git checkout ${latest}

Expand All @@ -33,7 +33,7 @@ RUN service postgresql start && su - postgres -c 'psql -U postgres -c "create da
# su - postgres -c "psql -U postgres -d postgres -c \"alter user postgres with password 'test';\""

# creates an env with the depepencies
RUN conda create --yes -n odm2adminenv -c conda-forge python=2.7 --file /ODM2-Admin/requirements.txt
RUN conda create --yes -n odm2adminenv -c conda-forge python=2.7 pytz gdal --file /ODM2-Admin/requirements.txt
RUN update-rc.d postgresql enable

COPY development.py /ODM2-Admin/templatesAndSettings/settings/
Expand Down
6 changes: 3 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Requirements to run [docker image](https://hub.docker.com/r/lsetiawan/odm2admin/):

1. ODM2 Database backup sql for PostgreSQL called odm2admindb.backup.
2. Docker installed on Linux or MacOS, currently not working on windows.
1. Docker installed on Linux, MacOS, or Windows.

To run:
$ docker run -d -p 8010:8010 -v path/to/local/db/backup/folder/:/db/ lsetiawan/odm2admin:latest
$ docker run -d -p 8010:8010 --name odm2admintest lsetiawan/odm2admin:latest
3 changes: 2 additions & 1 deletion docker/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

echo "Activating environment..."
source activate odm2adminenv
conda install --yes -c conda-forge pytz

echo "Building database..."
su - postgres -c 'pg_restore -d odm2_db -1 -v "/db/odm2admindb.backup"'
su - postgres -c 'pg_restore -d odm2_db -1 -v "/ODM2-Admin/ODM2AdminExamplePostgresqlDB"'
su - postgres -c "psql -U postgres -d postgres -c \"alter user postgres with password 'test';\""

echo "Running server..."
Expand Down

0 comments on commit d6b1628

Please sign in to comment.