Commit b017d38c authored by Guilherme Augusto Nunes Silva's avatar Guilherme Augusto Nunes Silva

Merge branch 'fixing_docker' into 'master'

Fixing docker environment and ci runner

See merge request lappis-unb/projects/SMI-UnB!2
parents 78e08e3d 1acb5ff0
Pipeline #32003088 passed with stage
in 4 minutes and 13 seconds
image: python:3
image: python:3.5
services:
- postgres:9.6
......@@ -19,4 +19,4 @@ test:
stylesheet:
script:
- flake8 src/ --exclude migrations
\ No newline at end of file
- flake8 src/ --exclude migrations
* * * * * export $(cat /root/env | xargs) && python3 /app/manage.py runcrons smi_unb.data_reader.cronjob.DataCollectCronJob
# Necessary line at end of file to make cron valid
\ No newline at end of file
# Necessary line at end of file to make cron valid
......@@ -4,28 +4,31 @@ RUN apt-get update &&\
apt-get install --no-install-recommends --no-install-suggests -y \
\
# Extra deps
cron \
python3-pip
cron \
libpq-dev \
python3-pip \
postgresql \
postgresql-client
# Base deps
RUN pip3 install \
requests[security] \
django==1.9.8 \
django==2.0.2 \
psycopg2==2.6.2 \
gunicorn \
redis==2.10.3 \
django-redis==4.8.0 \
django-redis==4.3.0 \
invoke \
numpy \
pandas \
Sphinx \
django-polymorphic \
django-polymorphic==2.0.2 \
manuel \
mpld3 \
six \
unipath \
django_cron \
matplotlib \
matplotlib==3.0.0 \
djangorestframework
RUN mkdir -p /app
......@@ -57,4 +60,4 @@ RUN /usr/bin/crontab /etc/cron.d/smi-cron
# Initializing container with script
ADD scripts/start.sh /bin/start.sh
CMD /bin/bash /bin/start.sh
\ No newline at end of file
CMD /bin/bash /bin/start.sh
......@@ -4,28 +4,31 @@ RUN apt-get update &&\
apt-get install --no-install-recommends --no-install-suggests -y \
\
# Extra deps
cron \
python3-pip
cron \
libpq-dev \
python3-pip \
postgresql \
postgresql-client
# Base deps
RUN pip3 install \
requests[security] \
django==1.9.8 \
django==2.0.2 \
psycopg2==2.6.2 \
gunicorn \
redis==2.10.3 \
django-redis==4.8.0 \
django-redis==4.3.0 \
invoke \
numpy \
pandas \
Sphinx \
django-polymorphic \
django-polymorphic==2.0.2 \
manuel \
mpld3 \
six \
unipath \
django_cron \
matplotlib \
matplotlib==3.0.0 \
djangorestframework
RUN mkdir -p /app
......@@ -57,4 +60,4 @@ RUN /usr/bin/crontab /etc/cron.d/smi-cron
# Initializing container with script
ADD scripts/start.sh /bin/start.sh
CMD /bin/bash /bin/start.sh
\ No newline at end of file
CMD /bin/bash /bin/start.sh
......@@ -3,9 +3,14 @@
# Exporting all environment variables to use in crontab
env | sed 's/^\(.*\)$/ \1/g' > /root/env
while ! pg_isready -h $DB_SERVICE -p $DB_PORT -q -U $DB_USER; do
>&2 echo "Postgres is unavailable - sleeping..."
sleep 1
done
# Populating database and Initializing cron and gunicorn
python3 manage.py makemigrations && \
python3 manage.py migrate && \
python3 manage.py loaddata src/smi_unb/fixtures/initial_data.json && \
cron && \
gunicorn smi_unb.wsgi -b 0.0.0.0:8000
\ No newline at end of file
gunicorn smi_unb.wsgi -b 0.0.0.0:8000
......@@ -67,7 +67,7 @@ class SyncUtils(object):
@classmethod
def generate_endpoint_url(
cls, slave_ip, new, api_view_set,
instance_id='', query_params='', port='8000'
instance_id='', query_params='', port='80'
):
endpoint_url = ''
......
......@@ -124,7 +124,7 @@ class TestUsersViews(TestCase):
login_url = reverse('authentication:make_login')
params = {
'email': 'admin@admin.com',
'username': 'admin@admin.com',
'password': '12345'
}
......
......@@ -89,7 +89,7 @@ class GraphPlotManager(object):
# Creating Figure and Subplots
fig = Figure(figsize=(10, 5))
ax = fig.add_subplot(1, 1, 1, axisbg='#EEEEEE')
ax = fig.add_subplot(1, 1, 1, facecolor='#EEEEEE')
self.set_subplot_basic_information(ax, measurement_type)
......
......@@ -87,14 +87,13 @@ EMAIL_HOST_USER = 'smeunb2016@gmail.com'
EMAIL_HOST_PASSWORD = 'mdsgpp2016'
DEFAULT_FROM_EMAIL = 'smeunb2016@gmail.com'
MIDDLEWARE_CLASSES = [
MIDDLEWARE = [
'django.middleware.locale.LocaleMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
......
Markdown is supported
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