Skip to content

Commit

Permalink
Add MSYS_NO_PATHCONV=1 to init scripts to fix path breakage by Docker…
Browse files Browse the repository at this point in the history
… Toolbox-Mingw shell.

Add ssh_tunnel.sh script to enable use of 'localhost' with Docker Toolbox.

Now init_pybossa.sh will reset and init the database from environment var PYBOSSA_DATABASE_URL.

Configure Pybossa container to use generic postgres container.

Upgrade to PostgreSQL 9.6 containers to match production db.

Remove obsolete db container that was configured for use by both TT and Pybossa.
  • Loading branch information
normangilmore committed Jul 8, 2017
1 parent 3ea0d0c commit 60e8e93
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 66 deletions.
File renamed without changes.
36 changes: 23 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,33 @@ services:
django_rq:
image: redis:3.2.9

db:
image: postgres:9.6
environment:
- TERM=xterm
- POSTGRES_USER=zz
- POSTGRES_PASSWORD=testonly3UkM429Yp
- POSTGRES_DB=thresher

pybossa:
# ubuntu:14.04 installs postgres 9.4 client
image: goodly/pybossa:latest
environment:
- PYBOSSA_SECRET=test-only-y8y2i4ISpfwEMhLjUfXH9e5qA8qJkKA31tuLakvy
- PYBOSSA_SESSION_SECRET=test-only-y8y2i4ISpfwEMhLjUfXH9e5qA8qJkKA31tuLakvy
- PYBOSSA_DATABASE_URL=postgresql://dfuser:test-only-RDkWWAG9jXMAFO8pXu6K@pybossa-db/dforce
- PYBOSSA_ITSDANGEROUS_SECRET=test-only-2R1ucOk8KxEeh5SCaXcWPt4oDf2sHQvpiyHAPoyX
- PYBOSSA_BRAND=Deciding Force
- PYBOSSA_TITLE=Deciding Force
- PYBOSSA_LOGO=default_logo.svg
depends_on:
- db
- pybossa-db
ports:
- "3002:80"

db:
# postgres:9.4
build:
context: ./docker
dockerfile: ./db/Dockerfile
# volumes:
# - ./_postgres_data:/var/lib/postgresql/data/
pybossa-db:
image: postgres:9.6
environment:
- POSTGRES_USER=zz
- POSTGRES_PASSWORD=testonly3UkM429Yp
- POSTGRES_DB=thresher
# - PGDATA=/var/lib/postgresql/data/pgdata
- TERM=xterm
- POSTGRES_USER=dfuser
- POSTGRES_PASSWORD=test-only-RDkWWAG9jXMAFO8pXu6K
- POSTGRES_DB=dforce
19 changes: 0 additions & 19 deletions docker/db/Dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions docker/db/init-user-db.sh

This file was deleted.

14 changes: 0 additions & 14 deletions docker/db/reset_pybossa_db.sh

This file was deleted.

3 changes: 3 additions & 0 deletions init_django.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# MSYS_NO_PATHCONV fixes paths on Docker Toolbox on Windows using Git Bash / Mingw
# Harmless everywhere else.
export MSYS_NO_PATHCONV=1
# Must use 'exec' since ./manage.py collectstatic modifies the container
docker-compose exec thresher_api sh /home/thresher/docker/thresher_api/init_django.sh
# DB updates can use either 'run' or 'exec'
Expand Down
3 changes: 3 additions & 0 deletions init_docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# MSYS_NO_PATHCONV fixes paths on Docker Toolbox on Windows using Git Bash / Mingw
# Harmless everywhere else.
export MSYS_NO_PATHCONV=1
# Maintain original behavior of loading annotations.
# If you don't want to load annotations, just run these two init scripts
# separately, without parameters.
Expand Down
8 changes: 7 additions & 1 deletion init_pybossa.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
#!/bin/bash
docker-compose run pybossa sh /ansible_build/init_db.sh
# MSYS_NO_PATHCONV fixes paths on Docker Toolbox on Windows using Git Bash / Mingw
# Harmless everywhere else.
export MSYS_NO_PATHCONV=1
docker-compose exec pybossa supervisorctl stop pybossa
docker-compose exec --user pybossa pybossa sh /ansible_build/reset_pybossa_db.sh
docker-compose exec --user pybossa pybossa sh /ansible_build/init_db.sh
docker-compose exec pybossa supervisorctl start pybossa
3 changes: 3 additions & 0 deletions init_thresher.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash
# MSYS_NO_PATHCONV fixes paths on Docker Toolbox on Windows using Git Bash / Mingw
# Harmless everywhere else.
export MSYS_NO_PATHCONV=1
# Must use 'exec' since ./manage.py collectstatic modifies the container
docker-compose exec thresher_api sh /home/thresher/docker/thresher_api/init_all.sh "$1"
5 changes: 0 additions & 5 deletions reset_pybossa.sh

This file was deleted.

2 changes: 2 additions & 0 deletions ssh_tunnel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
ssh -L 3002:$(docker-machine ip):3002 -L 5000:$(docker-machine ip):5000 docker@$(docker-machine ip)

0 comments on commit 60e8e93

Please sign in to comment.