@@ -4,14 +4,21 FROM python:2.7.11 | |||||
4 | RUN mkdir /radarsys |
|
4 | RUN mkdir /radarsys | |
5 | WORKDIR /radarsys |
|
5 | WORKDIR /radarsys | |
6 |
|
6 | |||
7 | # Copy the main application. |
|
|||
8 | COPY . ./ |
|
|||
9 |
|
||||
10 | # Install python dependences |
|
7 | # Install python dependences | |
|
8 | ADD requirements.txt ./requirements.txt | |||
11 | RUN pip install -v --timeout 120 -r requirements.txt --no-cache-dir |
|
9 | RUN pip install -v --timeout 120 -r requirements.txt --no-cache-dir | |
12 |
|
10 | |||
13 | EXPOSE 3000 |
|
11 | # Copy the main application. | |
|
12 | COPY . ./ | |||
|
13 | #RUN mkdir /radarsys media | |||
|
14 | # RUN python manage.py makemigrations \ | |||
|
15 | # && python manage.py migrate \ | |||
|
16 | # && python manage.py loaddata apps/main/fixtures/main_initial_data.json \ | |||
|
17 | # && python manage.py loaddata apps/rc/fixtures/rc_initial_data.json \ | |||
|
18 | # && python manage.py loaddata apps/jars/fixtures/initial_filters_data.json \ | |||
|
19 | RUN python manage.py collectstatic --noinput | |||
|
20 | #EXPOSE 3000 | |||
14 | # CMD ["python", "manage.py", "runserver", "0.0.0.0:3000"] |
|
21 | # CMD ["python", "manage.py", "runserver", "0.0.0.0:3000"] | |
15 | # Para produccion: |
|
22 | # Para produccion: | |
16 | CMD ["gunicorn", "radarsys.wsgi:application", "--bind", "0.0.0.0:3000"] |
|
23 | #CMD ["gunicorn", "radarsys.wsgi:application", "--bind", "0.0.0.0:3000"] | |
17 |
|
24 |
@@ -90,7 +90,7 DATABASES = { | |||||
90 | 'ENGINE': 'django.db.backends.mysql', |
|
90 | 'ENGINE': 'django.db.backends.mysql', | |
91 | 'NAME': 'radarsys', |
|
91 | 'NAME': 'radarsys', | |
92 | 'USER': 'developer', |
|
92 | 'USER': 'developer', | |
93 |
#'HOST': 'mysql |
|
93 | #'HOST': 'mysql', | |
94 | 'PASSWORD': 'idi2015', |
|
94 | 'PASSWORD': 'idi2015', | |
95 | 'OPTIONS': { |
|
95 | 'OPTIONS': { | |
96 | 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", |
|
96 | 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", | |
@@ -140,9 +140,16 FIXTURE_DIRS = ( | |||||
140 | ) |
|
140 | ) | |
141 |
|
141 | |||
142 | # Celery stuff |
|
142 | # Celery stuff | |
143 |
|
143 | REDIS_HOST = 'redis' | ||
144 | BROKER_URL = 'redis://localhost:6379' |
|
144 | BROKER_TRANSPORT = 'redis' | |
145 | CELERY_RESULT_BACKEND = 'redis://localhost:6379' |
|
145 | #--Development--# (Para Pruebas Locales) | |
|
146 | BROKER_URL = 'redis://127.0.0.1:6300' | |||
|
147 | CELERY_RESULT_BACKEND = 'redis://localhost:6300' | |||
|
148 | #---------------# | |||
|
149 | #--Production---# (Para Docker) | |||
|
150 | #CELERY_BROKER_TRANSPORT = BROKER_URL = 'redis://%s:6379/0' % REDIS_HOST | |||
|
151 | #CELERY_RESULT_BACKEND = 'redis://%s:6379/0' % REDIS_HOST | |||
|
152 | #---------------# | |||
146 | CELERY_ACCEPT_CONTENT = ['application/json'] |
|
153 | CELERY_ACCEPT_CONTENT = ['application/json'] | |
147 | CELERY_TASK_SERIALIZER = 'json' |
|
154 | CELERY_TASK_SERIALIZER = 'json' | |
148 | CELERY_RESULT_SERIALIZER = 'json' |
|
155 | CELERY_RESULT_SERIALIZER = 'json' |
@@ -15,7 +15,7 Including another URLconf | |||||
15 | """ |
|
15 | """ | |
16 | from django.conf.urls import include, url |
|
16 | from django.conf.urls import include, url | |
17 | from django.contrib import admin |
|
17 | from django.contrib import admin | |
18 | from django.contrib.staticfiles.urls import staticfiles_urlpatterns |
|
18 | #from django.contrib.staticfiles.urls import staticfiles_urlpatterns | |
19 |
|
19 | |||
20 | urlpatterns = [ |
|
20 | urlpatterns = [ | |
21 | url(r'^admin/', include(admin.site.urls)), |
|
21 | url(r'^admin/', include(admin.site.urls)), | |
@@ -30,4 +30,4 urlpatterns = [ | |||||
30 | url(r'^misc/', include('apps.misc.urls')), |
|
30 | url(r'^misc/', include('apps.misc.urls')), | |
31 | ] |
|
31 | ] | |
32 |
|
32 | |||
33 | urlpatterns += staticfiles_urlpatterns() |
|
33 | #urlpatterns += staticfiles_urlpatterns() |
@@ -31,6 +31,9 docker run -d --name radarsys01 --link mysql-radarsys-server -p 3000:3000 \ | |||||
31 | MEDIA_ROOT: 'media' |
|
31 | MEDIA_ROOT: 'media' | |
32 | ### En el script abs/utils/Graphics_OverJro.py, matplotlib Agg debe estar habilitado |
|
32 | ### En el script abs/utils/Graphics_OverJro.py, matplotlib Agg debe estar habilitado | |
33 | matplotlib.use("Agg") |
|
33 | matplotlib.use("Agg") | |
|
34 | ### En el script radarsys/urls.py comentar para que nginx sirva "static": | |||
|
35 | #from django.contrib.staticfiles.urls import staticfiles_urlpatterns | |||
|
36 | #urlpatterns += staticfiles_urlpatterns() | |||
34 |
|
37 | |||
35 | ### Ejecutar los siguientes comandos (solo si ya se creo mysql-radarsys-server): |
|
38 | ### Ejecutar los siguientes comandos (solo si ya se creo mysql-radarsys-server): | |
36 | python manage.py makemigrations \ |
|
39 | python manage.py makemigrations \ |
General Comments 0
You need to be logged in to leave comments.
Login now