Commit 63a652e8 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'master' into fix/69-fix-boardpages

parents d8eb6af8 83a42bf7
FROM python:3.5-alpine
MAINTAINER Thom Wiggers <thom@thomwiggers.nl>
LABEL version=1.0
LABEL description="Contains the Thaliawebsite Django application"
# Try to keep static operation on top to maximise Docker cache utilisation
# Disable output buffering
ENV DJANGO_PRODUCTION 1
ENV PYTHONUNBUFFERED 1
# Create log dir
RUN mkdir /log/
RUN touch /log/uwsgi.log
# Create app directory
RUN mkdir -p /usr/src/app
# Create entry points
WORKDIR /usr/local/bin
COPY resources/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY resources/entrypoint_production.sh /usr/local/bin/entrypoint_production.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint_production.sh
# Install dependencies
RUN apk add --no-cache \
gettext \
bash \
postgresql-client \
libwebp \
tiff \
zlib \
freetype \
uwsgi \
lcms2 \
libjpeg-turbo \
nodejs
# Install build deps
RUN apk add --no-cache --virtual .builddeps \
build-base \
tiff-dev \
libjpeg-turbo-dev \
zlib-dev \
freetype-dev \
lcms2-dev \
libwebp-dev \
postgresql-dev
WORKDIR /usr/src/app
# install python requirements
COPY requirements.txt /usr/src/app/
COPY production-requirements.txt /usr/src/app/
RUN pip install --no-cache-dir \
-r requirements.txt \
-r production-requirements.txt
# Install nodejs-less
RUN npm install -g less mkdirp
RUN apk del .builddeps
# copy app source
COPY website /usr/src/app/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["--help"]
version: '2'
services:
postgres:
image: postgres
environment: &postgresvars
POSTGRES_DB: thalia
web:
build: .
command: runserver 0.0.0.0:8000
ports:
- 8000:8000
depends_on:
- postgres
volumes:
- ./website:/usr/src/app
environment:
<<: *postgresvars
DJANGO_DEBUG: 'True'
DJANGO_POSTGRES_HOST: postgres
#!/bin/bash
set -e
until psql -h "$DJANGO_POSTGRES_HOST" -U "postgres" -c '\l'; do
>&2 echo "PostgreSQL is unavailable: Sleeping"
sleep 5
done
>&2 echo "PostgreSQL is up"
cd /usr/src/app
>&2 echo "Running ./manage.py $@"
./manage.py $@
#!/bin/bash
set -e
until psql -h "$DJANGO_POSTGRES_HOST" -U "postgres" -c '\l'; do
>&2 echo "PostgreSQL is unavailable: Sleeping"
sleep 5
done
>&2 echo "PostgreSQL is up"
cd /usr/src/app
>&2 echo "Running site with uwsgi"
uwsgi --chdir /usr/src/app \
--socket :8000 \
--threads 2 \
--processes 4 \
--module thaliawebsite.wsgi:application \
--lazy-app \
--harakiri 20 \
--max-requests 5000 \
--vacuum \
--logto '/log/uwsgi.log'
from django.apps import AppConfig
class CommitteesConfig(AppConfig):
name = 'committees'
class ActiveMembersConfig(AppConfig):
name = 'activemembers'
[
{
"model": "committees.committee",
"model": "activemembers.committee",
"pk": 1,
"fields": {
"name": "testcie1",
......@@ -14,7 +14,7 @@
}
},
{
"model": "committees.committee",
"model": "activemembers.committee",
"pk": 2,
"fields": {
"name": "testcie2",
......
......@@ -9,7 +9,7 @@ import django.db.models.manager
class Migration(migrations.Migration):
replaces = [('committees', '0001_initial'), ('committees', '0002_committee_permissions'), ('committees', '0003_auto_20160707_1356'), ('committees', '0004_auto_20160707_1357'), ('committees', '0005_auto_20160707_1512'), ('committees', '0006_auto_20160707_1700')]
replaces = [('activemembers', '0001_initial'), ('activemembers', '0002_committee_permissions'), ('activemembers', '0003_auto_20160707_1356'), ('activemembers', '0004_auto_20160707_1357'), ('activemembers', '0005_auto_20160707_1512'), ('activemembers', '0006_auto_20160707_1700')]
initial = True
......@@ -35,7 +35,7 @@ class Migration(migrations.Migration):
('since', models.DateField(auto_now_add=True)),
('until', models.DateField()),
('chair', models.BooleanField()),
('committee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='committees.Committee')),
('committee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='activemembers.Committee')),
('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='members.Member')),
],
managers=[
......@@ -45,7 +45,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='committee',
name='members',
field=models.ManyToManyField(through='committees.CommitteeMembership', to='members.Member'),
field=models.ManyToManyField(through='activemembers.CommitteeMembership', to='members.Member'),
),
migrations.AddField(
model_name='committee',
......@@ -68,7 +68,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='committeemembership',
name='committee',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='committees.Committee', verbose_name='Committee'),
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='activemembers.Committee', verbose_name='Committee'),
),
migrations.AlterField(
model_name='committeemembership',
......
......@@ -10,7 +10,7 @@ import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
('committees', '0001_squashed_0006_auto_20160707_1700'),
('activemembers', '0001_squashed_0006_auto_20160707_1700'),
]
operations = [
......
......@@ -9,17 +9,17 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('committees', '0002_auto_20160713_1558'),
('activemembers', '0002_auto_20160713_1558'),
]
operations = [
migrations.CreateModel(
name='Board',
fields=[
('committee_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='committees.Committee')),
('committee_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='activemembers.Committee')),
('is_board', models.BooleanField(default=True, verbose_name='Is this a board')),
],
bases=('committees.committee',),
bases=('activemembers.committee',),
),
migrations.AddField(
model_name='committeemembership',
......
......@@ -8,7 +8,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('committees', '0003_auto_20160713_1700'),
('activemembers', '0003_auto_20160713_1700'),
]
operations = [
......
......@@ -8,7 +8,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('committees', '0004_auto_20160727_2253'),
('activemembers', '0004_auto_20160727_2253'),
]
operations = [
......
......@@ -8,7 +8,7 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('committees', '0005_auto_20160813_2203'),
('activemembers', '0005_auto_20160813_2203'),
]
operations = [
......
......@@ -9,7 +9,7 @@ class Migration(migrations.Migration):
dependencies = [
('members', '0006_auto_20160824_2041'),
('committees', '0006_auto_20160817_2236'),
('activemembers', '0006_auto_20160817_2236'),
]
operations = [
......
......@@ -8,7 +8,7 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('committees', '0007_mentors'),
('activemembers', '0007_mentors'),
]
operations = [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment