diff --git a/develop.sh b/bash_thresher.sh similarity index 100% rename from develop.sh rename to bash_thresher.sh diff --git a/docker-compose.yml b/docker-compose.yml index aba516a..cdbe735 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/docker/db/Dockerfile b/docker/db/Dockerfile deleted file mode 100644 index 8decd3d..0000000 --- a/docker/db/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM postgres:9.4 -ENV TERM xterm - -# helpful aliases -COPY bashrc_to_docker /root/.bashrc - -# ARG vars exist only during build -ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update -q -RUN apt-get install -q -y apt-utils -RUN apt-get install -q -y less vim-tiny - -RUN rm -rf /var/lib/apt/lists/* - -WORKDIR /scripts -COPY ./db/reset_pybossa_db.sh . - -WORKDIR /docker-entrypoint-initdb.d -COPY ./db/init-user-db.sh . diff --git a/docker/db/init-user-db.sh b/docker/db/init-user-db.sh deleted file mode 100755 index 1dce711..0000000 --- a/docker/db/init-user-db.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username postgres postgres <<-EOSQL - CREATE USER pybossa WITH CREATEDB NOSUPERUSER ENCRYPTED PASSWORD 'tester'; - CREATE DATABASE pybossa OWNER pybossa - ENCODING 'UTF-8' LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8' - TEMPLATE template0; - -- Create test user and test DB - CREATE USER rtester WITH CREATEDB NOSUPERUSER; - CREATE DATABASE pybossa_test OWNER rtester - ENCODING 'UTF-8' LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8' - TEMPLATE template0; -EOSQL diff --git a/docker/db/reset_pybossa_db.sh b/docker/db/reset_pybossa_db.sh deleted file mode 100755 index 61bebcb..0000000 --- a/docker/db/reset_pybossa_db.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username postgres postgres <<-EOSQL - DROP DATABASE IF EXISTS pybossa; - CREATE DATABASE pybossa OWNER pybossa - ENCODING 'UTF-8' LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8' - TEMPLATE template0; - -- Create test DB - DROP DATABASE IF EXISTS pybossa_test; - CREATE DATABASE pybossa_test OWNER rtester - ENCODING 'UTF-8' LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8' - TEMPLATE template0; -EOSQL diff --git a/init_django.sh b/init_django.sh index 00c12e4..6b40499 100755 --- a/init_django.sh +++ b/init_django.sh @@ -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' diff --git a/init_docker.sh b/init_docker.sh index 88df016..62eed23 100755 --- a/init_docker.sh +++ b/init_docker.sh @@ -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. diff --git a/init_pybossa.sh b/init_pybossa.sh index 6e127f2..4b2f8bd 100755 --- a/init_pybossa.sh +++ b/init_pybossa.sh @@ -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 diff --git a/init_thresher.sh b/init_thresher.sh index 1dc6278..b48ad97 100755 --- a/init_thresher.sh +++ b/init_thresher.sh @@ -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" diff --git a/reset_pybossa.sh b/reset_pybossa.sh deleted file mode 100755 index 27e96cf..0000000 --- a/reset_pybossa.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -docker-compose exec pybossa supervisorctl stop pybossa -docker-compose exec db sh /scripts/reset_pybossa_db.sh -docker-compose exec pybossa supervisorctl start pybossa -docker-compose run pybossa sh /ansible_build/init_db.sh diff --git a/ssh_tunnel.sh b/ssh_tunnel.sh new file mode 100755 index 0000000..c0f3f95 --- /dev/null +++ b/ssh_tunnel.sh @@ -0,0 +1,2 @@ +#!/bin/bash +ssh -L 3002:$(docker-machine ip):3002 -L 5000:$(docker-machine ip):5000 docker@$(docker-machine ip)