-
Notifications
You must be signed in to change notification settings - Fork 534
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
Showing
69 changed files
with
2,268 additions
and
157 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
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,41 @@ | ||
# Ralph | ||
# | ||
# VERSION 2.0.0-3 | ||
|
||
FROM ubuntu | ||
MAINTAINER Marcin Kliks marcin.kliks@allegro.pl | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y python2.7 python-dev python-virtualenv build-essential libbz2-dev libfreetype6-dev libgdbm-dev libxft-dev | ||
RUN apt-get install -y libjpeg-dev libldap2-dev libltdl-dev libmysqlclient-dev libreadline-dev libsasl2-dev libsqlite3-dev | ||
RUN apt-get install -y libssl-dev libxslt1-dev ncurses-dev zlib1g-dev | ||
RUN apt-get install -y libcap2-bin | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y redis-server mysql-server libmysqlclient-dev libmysqld-dev | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server apache2 supervisor | ||
RUN apt-get install -y git | ||
RUN /usr/bin/mysqld_safe & \ | ||
sleep 10s && \ | ||
echo "CREATE DATABASE ralph DEFAULT CHARACTER SET 'utf8'" | mysql && \ | ||
echo "GRANT ALL ON ralph.* TO ralph@'%' IDENTIFIED BY 'ralph'; FLUSH PRIVILEGES" | mysql | ||
#RUN echo 'alter database ralph character set utf8 collate utf8_polish_ci' | mysql -u root | ||
RUN pip install -U pip | ||
RUN pip install -U flake8 | ||
RUN git clone http://github.com/allegro/ralph.git /root/ralph-git/ralph | ||
RUN cd /root/ralph-git/ralph; make install | ||
RUN ralph makeconf | ||
ADD settings /.ralph/additional-settings | ||
ADD createsuperuser.py /root/createsuperuser.py | ||
RUN cat /.ralph/additional-settings >>/.ralph/settings | ||
RUN /usr/bin/mysqld_safe & \ | ||
sleep 10 && \ | ||
ralph syncdb --all --noinput && \ | ||
ralph migrate --fake && \ | ||
ralph createsuperuser ralph --noinput --user ralph --email ralph@allegrogroup.com && \ | ||
python /root/createsuperuser.py && \ | ||
ralph collectstatic -l --noinput | ||
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
|
||
EXPOSE 8000 22 | ||
|
||
CMD ["/usr/bin/supervisord"] | ||
|
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,11 @@ | ||
|
||
import os | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ralph.settings") | ||
|
||
from django.contrib.auth.models import User | ||
|
||
u = User.objects.get(username='ralph') | ||
u.set_password('ralph') | ||
u.is_superuser = True | ||
u.is_staff = True | ||
u.save() |
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,35 @@ | ||
DEBUG = True | ||
TEMPLATE_DEBUG = True | ||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.mysql', | ||
'NAME': 'ralph', | ||
'USER': 'ralph', | ||
'PASSWORD': 'ralph', | ||
'HOST': '', | ||
'PORT': '', | ||
'OPTIONS': dict( | ||
), | ||
}, | ||
} | ||
CACHES = dict( | ||
default=dict( | ||
BACKEND='django.core.cache.backends.locmem.LocMemCache', | ||
LOCATION='', | ||
TIMEOUT=300, | ||
OPTIONS=dict( | ||
), | ||
KEY_PREFIX='RALPH_', | ||
) | ||
) | ||
RQ_QUEUE_LIST = ('reports', 'reports_pricing', 'default') | ||
|
||
RQ_QUEUES = { | ||
'default': { | ||
'HOST': 'localhost', | ||
'PORT': 6379, | ||
'DB': 0, | ||
}, | ||
} | ||
for queue in RQ_QUEUE_LIST: | ||
RQ_QUEUES[queue] = dict(RQ_QUEUES['default']) |
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,18 @@ | ||
[supervisord] | ||
nodaemon=true | ||
|
||
[program:mysql] | ||
command=/usr/bin/mysqld_safe | ||
priority=11 | ||
|
||
[program:redis] | ||
command=redis-server | ||
priority=12 | ||
|
||
[program:rqworker] | ||
command=ralph rqworker default reports reports_pricing | ||
priority=13 | ||
|
||
[program:gunicorn] | ||
command=ralph run_gunicorn -w8 0.0.0.0:8000 | ||
priority=14 |
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
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
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
Oops, something went wrong.