This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
forked from ofri/Open-Knesset
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
977a0c3
commit 99e87de
Showing
5 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM ubuntu:14.04 | ||
MAINTAINER Doody Parizada <doody.parizada @ gmail.com> | ||
|
||
# install apt dependencies | ||
RUN apt-get update -y && \ | ||
apt-get install -y build-essential git python python-dev python-setuptools python-pip && \ | ||
apt-get build-dep -y python-imaging python-lxml && \ | ||
pip install --upgrade pip && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN mkdir -p /opt/knesset /opt/database | ||
|
||
# download database file into database location | ||
WORKDIR /opt/database | ||
RUN apt-get install -y wget && \ | ||
wget http://oknesset-devdb.s3.amazonaws.com/dev.db.bz2 && \ | ||
bzip2 -d dev.db.bz2 && \ | ||
apt-get purge -y --auto-remove wget | ||
|
||
# install python requirements | ||
COPY requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt | ||
|
||
VOLUME ["/opt/knesset"] | ||
WORKDIR /opt/knesset | ||
EXPOSE 8000 | ||
|
||
# set up entry point and default command | ||
COPY docker/entrypoint.sh /tmp/entrypoint.sh | ||
ENTRYPOINT ["/tmp/entrypoint.sh"] | ||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
knesset: | ||
image: doodyparizada/open-knesset | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- .:/opt/knesset | ||
working_dir: /opt/knesset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"""Extension and overloading for running in docker.""" | ||
import logging | ||
import sys | ||
|
||
|
||
DATABASES = { | ||
'default': { | ||
'NAME': '/opt/database/dev.db', | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
}, | ||
} | ||
|
||
logger = logging.getLogger("open-knesset") | ||
logger.handlers = [] | ||
logger.setLevel(logging.DEBUG) # override this in prod server to logging.ERROR | ||
h = logging.StreamHandler(sys.stdout) | ||
h.setLevel(logging.DEBUG) | ||
formatter = logging.Formatter("%(asctime)s\t%(name)s:%(lineno)d\t%(levelname)s\t%(message)s") | ||
h.setFormatter(formatter) | ||
logger.addHandler(h) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
cp docker/docker_settings.py knesset/local_settings.py && \ | ||
python manage.py migrate && \ | ||
python manage.py createsuperuser --noinput --username=superuser [email protected] && \ | ||
$* |