From 9fb9996df4d3f46ab714fc83a8f244295e192ed0 Mon Sep 17 00:00:00 2001 From: Lorena Vasiloaia Date: Sat, 29 Jun 2019 17:00:34 +0300 Subject: [PATCH 1/3] Dockerfile for catpol app --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c05c4c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.5.7-alpine3.10 +RUN apk add git +WORKDIR /opt/catpol +COPY ./requirements* /opt/catpol/ +RUN pip3 install -r requirements-dev.txt +COPY . /opt/catpol +ENV DJANGO_SETTINGS_MODULE=project_template.settings.dev +RUN python3 manage.py migrate +CMD python3 manage.py runserver 0.0.0.0:8000 +EXPOSE 8000 From f852eae5806d89d120c39dfe082996656bc5c927 Mon Sep 17 00:00:00 2001 From: Lorena Vasiloaia Date: Sat, 29 Jun 2019 17:01:08 +0300 Subject: [PATCH 2/3] Compose file for catpol and dependent services --- docker-compose.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1067e3d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,58 @@ +version: "2" +services: + catpol: + build: . + depends_on: + - postgres + - pybossa + ports: + - "8000:8000" + redis-master: + image: 'redis:3.0-alpine' + redis-sentinel: + image: 'jvstein/redis-sentinel:latest' + depends_on: + - redis-master + links: + - redis-master + postgres: + image: 'postgres:9.6-alpine' + environment: + - POSTGRES_USER=pybossa + - POSTGRES_PASSWORD=bestpassword + # initializes the database + db-init: + image: 'jvstein/pybossa:latest' + depends_on: + - postgres + environment: + - POSTGRES_URL=postgresql://pybossa:bestpassword@db/pybossa + links: + - postgres:db + command: sh -c "sleep 5 && python cli.py db_create" + # background worker process + pybossa-bgworker: + image: 'jvstein/pybossa:latest' + depends_on: + - db-init + environment: + - POSTGRES_URL=postgresql://pybossa:bestpassword@db/pybossa + links: + - redis-master + - redis-sentinel + - postgres:db + command: rqscheduler --host redis-master + # web server + pybossa: + image: 'jvstein/pybossa:latest' + container_name: pybossa + depends_on: + - db-init + environment: + - POSTGRES_URL=postgresql://pybossa:bestpassword@db/pybossa + links: + - redis-master + - redis-sentinel + - postgres:db + ports: + - "8080:8080" From 73624b6e572b648859b265586237b8baa7359a71 Mon Sep 17 00:00:00 2001 From: Radu Stefanescu Date: Tue, 9 Jul 2019 14:57:24 +0300 Subject: [PATCH 3/3] Update docker-compose.yml Just add some generic password string. --- docker-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1067e3d..54de169 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,14 +19,14 @@ services: image: 'postgres:9.6-alpine' environment: - POSTGRES_USER=pybossa - - POSTGRES_PASSWORD=bestpassword + - POSTGRES_PASSWORD=XXXXXXXXXXXXXX # initializes the database db-init: image: 'jvstein/pybossa:latest' depends_on: - postgres environment: - - POSTGRES_URL=postgresql://pybossa:bestpassword@db/pybossa + - POSTGRES_URL=postgresql://pybossa:XXXXXXXXXXXXXX@db/pybossa links: - postgres:db command: sh -c "sleep 5 && python cli.py db_create" @@ -36,7 +36,7 @@ services: depends_on: - db-init environment: - - POSTGRES_URL=postgresql://pybossa:bestpassword@db/pybossa + - POSTGRES_URL=postgresql://pybossa:XXXXXXXXXXXXXX@db/pybossa links: - redis-master - redis-sentinel @@ -49,7 +49,7 @@ services: depends_on: - db-init environment: - - POSTGRES_URL=postgresql://pybossa:bestpassword@db/pybossa + - POSTGRES_URL=postgresql://pybossa:XXXXXXXXXXXXXX@db/pybossa links: - redis-master - redis-sentinel