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

Support running Colossus using Docker #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM debian:buster
MAINTAINER Abhas Abhinav <[email protected]>

RUN apt-get -y update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y vim less wget curl git net-tools telnet tcpdump netcat-openbsd python3 python3-pip procps rabbitmq-server
ADD . /home/colossus/
WORKDIR /home/colossus/
RUN pip3 install -r requirements/development.txt
RUN python3 manage.py migrate
EXPOSE 8000
CMD python3 manage.py runserver 0.0.0.0:8000
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,55 @@ http://127.0.0.1:8000/setup/

PS: Campaign scheduling will not work out-of-the-box. You need to install a message broker and [setup Celery](https://simpleisbetterthancomplex.com/tutorial/2017/08/20/how-to-use-celery-with-django.html) properly.

## Using Docker

### Building the image

You can build you own image for Colossus as follows:

```commandline
docker build -f <image-name> .
```

There is a pre-built image available at: [abhas/colossus](https://hub.docker.com/r/abhas/colossus/).

### Running Colossus via Docker

You can colossus using Docker with the following commandline:

```commandline
$ docker run -ti --name colossus -p 127.0.0.1:8000:8000 abhas/colossus 130 ↵
Performing system checks...

System check identified no issues (0 silenced).
November 12, 2018 - 09:24:40
Django version 2.1.3, using settings 'colossus.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C
```
Now connect to `http://127.0.0.1:8000/setup` and access the Colossus admin UI.

### Running RabbitMQ

RabbitMQ is installed within the docker container. To run it so that Colossus can deliver emails, do the following:

```commandline
$ docker exec -ti colossus bash
root@7d9cea59b4cb:/home/colossus# rabbitmq-server

## ##
## ## RabbitMQ 3.7.8. Copyright (C) 2007-2018 Pivotal Software, Inc.
########## Licensed under the MPL. See http://www.rabbitmq.com/
###### ##
########## Logs: /var/log/rabbitmq/[email protected]
/var/log/rabbitmq/rabbit@7d9cea59b4cb_upgrade.log

Starting broker...
completed with 0 plugins.
```

Now configure Colossus inside the container to use this rabbitmq instance for email delivery.

## Tech Specs

* Python 3.6
Expand Down