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

Dockerizing catpol and adding pybossa container dependency #173

Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
58 changes: 58 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
RaduCStefanescu marked this conversation as resolved.
Show resolved Hide resolved
# 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"