Remove docker compose setup, not working optimal. Might return later.

This commit is contained in:
Víðir Valberg Guðmundsson 2017-11-23 21:47:10 +01:00
parent 2e4a44271d
commit d4265edaa0
5 changed files with 9 additions and 94 deletions

View file

@ -1,8 +0,0 @@
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD src/requirements.txt /code/
RUN pip install -r requirements.txt
RUN apt-get update
RUN apt-get -y install wkhtmltopdf

View file

@ -1,24 +0,0 @@
all: copy_environment_settings build db_up sleep migrate bootstrap
copy_environment_settings:
cp src/bornhack/dev_environment_settings.py src/bornhack/environment_settings.py
build:
docker-compose build
db_up:
docker-compose up -d db
migrate:
docker-compose run web /usr/local/bin/python src/manage.py migrate
bootstrap:
docker-compose run web /usr/local/bin/python src/manage.py bootstrap-devsite
sleep:
echo "Sleeping to ensure that the db is up."; sleep 3
web_up:
docker-compose up web
run: db_up web_up

View file

@ -2,21 +2,9 @@
Django project to power Bornhack. Features include news, villages, webshop, and more.
## Quickstart
## Setup
### Using docker-compose
If you have docker-compose you can use the included make file. Like so:
$ make
This will create everything. You can now start the project running:
$ make run
### Manual way
#### Clone the repo
### Clone the repo
Clone with --recursive to include submodules:
git clone --recursive https://github.com/bornhack/bornhack-website
@ -25,14 +13,14 @@ If you already cloned the repository, you can add the submodules like this:
git submodule update --init --recursive
#### Virtualenv
### Virtualenv
Create a Python 3 virtual environment and activate it:
```
$ virtualenv venv -p python3
$ source venv/bin/activate
```
#### System libraries
### System libraries
Install system dependencies (method depends on OS):
- postgresql headers (for psycopg2):
- Debian: libpq-dev
@ -47,13 +35,13 @@ Install system dependencies (method depends on OS):
- Debian: ?
- FreeBSD: x11-fonts/webfonts
#### Python packages
### Python packages
Install pip packages:
```
(venv) $ pip install -r src/requirements.txt
```
#### Configuration file
### Configuration file
Copy environment settings file and change settings as needed:
```
(venv) $ cp src/bornhack/environment_settings.py.dist src/bornhack/environment_settings.py
@ -62,7 +50,7 @@ Copy environment settings file and change settings as needed:
Edit the configuration file, replacing all the ``{{ placeholder }}`` patterns
(intended for Ansible).
#### Database
### Database
Is this a new installation? Initialize the database:
```
(venv) $ src/manage.py migrate
@ -73,7 +61,7 @@ Is this for local development? Bootstrap the database with dummy data and users:
(venv) $ src/manage.py bootstrap-devsite
```
#### Deploy camps+program test data
### Deploy camps+program test data
Run this command to create a bunch of nice test data:
@ -82,7 +70,7 @@ Run this command to create a bunch of nice test data:
```
#### Done
### Done
Is this for local development? Start the Django devserver:
```
(venv) $ src/manage.py runserver

View file

@ -1,19 +0,0 @@
version: '2'
services:
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: bornhack
POSTGRES_USER: bornhack
POSTGRES_DB: bornhack
web:
build: .
command: python3 src/manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db

View file

@ -1,22 +0,0 @@
# This file is intended for easing the creation of a local development setup
SECRET_KEY = "something-very-random"
ALLOWED_HOSTS = "*"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'bornhack',
'USER': 'bornhack',
'PASSWORD': 'bornhack',
'HOST': 'db',
},
}
DEBUG=True
WKHTMLTOPDF_CMD="wkhtmltopdf"
CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgiref.inmemory.ChannelLayer",
"ROUTING": "bornhack.routing.channel_routing",
"CONFIG": {}
},
}
CAMP_REDIRECT_PERCENT=40