├── .env ├── LICENSE ├── README.md ├── docker-compose.yml ├── launch-bounca.sh └── nginx ├── Dockerfile └── sites-enabled └── django_project /.env: -------------------------------------------------------------------------------- 1 | # Add Environment Variables 2 | 3 | 4 | SECRET_KEY=5(15ds+i2+%ik6z&!yer+ga9m=e%jcqiz_5wszg)r-z!2--b2d 5 | DB_NAME=postgres 6 | DB_USER=postgres 7 | DB_PASS=postgres 8 | DB_SERVICE=postgres 9 | DB_PORT=5432 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Repleo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## BounCA Docker Compose file 2 | 3 | 4 | This repository contains **docker-compose.yml** of [BounCA](https://bounca.org/) for [Docker](https://www.docker.com/)'s [automated build](https://registry.hub.docker.com/u/repleo/bounca/) published to the public [Docker Hub Registry](https://registry.hub.docker.com/). 5 | This script automatically instantiate all the dependencies and launches it. 6 | 7 | 8 | ### Base Docker Image 9 | 10 | * debian:8.4 11 | 12 | 13 | ### Installation 14 | 15 | 1. Install [Docker](https://www.docker.com/), and make sure `docker-compose` and `docker-machine` is available. 16 | 17 | 2. Clone this repository 18 | 19 | 20 | ### Usage 21 | 22 | Run the script: `launch-bounca.sh` 23 | 24 | ### Author Information 25 | 26 | Jeroen Arnoldus (jeroen@repleo.nl) 27 | 28 | Repleo, Amstelveen, Holland -- www.repleo.nl 29 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | bounca: 2 | restart: always 3 | image: repleo/bounca:v0.1.0 4 | expose: 5 | - "8000" 6 | links: 7 | - postgres:postgres 8 | volumes: 9 | - /srv/www/bounca 10 | - /srv/www/bounca/static 11 | env_file: .env 12 | environment: 13 | DEBUG: 'true' 14 | command: /usr/local/bin/gunicorn bounca.wsgi:application -w 2 -b :8000 --chdir /srv/www/bounca 15 | 16 | nginx: 17 | restart: always 18 | build: ./nginx/ 19 | ports: 20 | - "80:80" 21 | volumes: 22 | - /www/static 23 | volumes_from: 24 | - bounca 25 | links: 26 | - bounca:bounca 27 | 28 | postgres: 29 | restart: always 30 | image: postgres:latest 31 | ports: 32 | - "5432:5432" 33 | volumes: 34 | - pgdata:/var/lib/postgresql/data/ 35 | -------------------------------------------------------------------------------- /launch-bounca.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | docker-machine create -d virtualbox bounca || true 4 | docker-machine stop bounca || true 5 | docker-machine start bounca || true 6 | eval $(docker-machine env bounca) 7 | docker-compose build 8 | docker-compose up -d 9 | docker-compose run bounca python3 /srv/www/bounca/manage.py migrate --noinput 10 | echo "Visit your BounCA installation:" 11 | docker-machine ip bounca 12 | -------------------------------------------------------------------------------- /nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tutum/nginx 2 | RUN rm /etc/nginx/sites-enabled/default 3 | ADD sites-enabled/ /etc/nginx/sites-enabled 4 | -------------------------------------------------------------------------------- /nginx/sites-enabled/django_project: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80; 4 | server_name example.org; 5 | charset utf-8; 6 | 7 | location /static { 8 | root /srv/www/bounca/media; 9 | include mime.types; 10 | } 11 | 12 | location / { 13 | proxy_pass http://bounca:8000; 14 | proxy_set_header Host $host; 15 | proxy_set_header X-Real-IP $remote_addr; 16 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 17 | } 18 | 19 | } --------------------------------------------------------------------------------