##// END OF EJS Templates
Update docker configuration & fix timezone
Juan C. Espinoza -
r305:a055088a3559
parent child
Show More
@@ -1,9 +1,11
1 1 REDIS_HOST=radarsys-redis
2 2 REDIS_PORT=6379
3 3 POSTGRES_DB_NAME=radarsys
4 4 POSTGRES_PORT_5432_TCP_ADDR=radarsys-postgres
5 5 POSTGRES_PORT_5432_TCP_PORT=5432
6 6 POSTGRES_USER=docker
7 7 POSTGRES_PASSWORD=docker
8 8 PGDATA=/var/lib/postgresql/data
9 9 LC_ALL=C.UTF-8
10 TZ=America/Lima
11 DOCKER_DATA=/Volumes/dockers/radarsys/
@@ -1,20 +1,20
1 1 FROM python:2.7-slim
2 2
3 3 # set working directory
4 4 RUN mkdir /radarsys
5 5 WORKDIR /radarsys
6 6
7 7 # Install python dependences
8 8 ADD requirements.txt ./requirements.txt
9 9 RUN apt-get clean && apt-get update && apt-get install -y --no-install-recommends \
10 10 gcc \
11 11 g++ \
12 && pip install -v --timeout 120 -r requirements.txt --no-cache-dir --index-url http://10.10.20.128:8010/simple --trusted-host 10.10.20.128 \
12 && pip install -v --timeout 120 -r requirements.txt --no-cache-dir \
13 13 && apt-get purge -y --auto-remove gcc g++\
14 14 && rm -rf /var/lib/apt/lists/*
15 15
16 16 # Copy the main application.
17 17 COPY . ./
18 18
19 19 EXPOSE 8000
20 20
@@ -1,63 +1,66
1 1 version: '2'
2 2 services:
3 3 # Django app
4 4 web:
5 5 container_name: 'radarsys'
6 6 build: .
7 7 restart: always
8 8 image: radarsys
9 9 command: gunicorn radarsys.wsgi:application -w 2 -b :8000
10 # command: python manage.py runserver 0.0.0.0:8030
11 # ports:
12 # - 8030:8030
10 13 env_file: .env
11 14
12 15 links:
13 16 - redis
14 17 - postgres
15 18 volumes:
16 19 - './:/radarsys'
17 - '/data/dockers/radarsys/static:/radarsys/static'
20 - '${DOCKER_DATA}/static:/radarsys/static'
18 21 depends_on:
19 22 - redis
20 23 - postgres
21 24
22 25 redis:
23 26 container_name: 'radarsys-redis'
24 27 image: 'redis:3.2-alpine'
25 28 volumes:
26 - '/data/dockers/radarsys/redis:/data'
29 - '${DOCKER_DATA}/redis:/data'
27 30
28 31 celery_worker:
29 32 container_name: 'radarsys-celery'
30 33 image: radarsys
31 34 env_file: .env
32 35 command: celery -A radarsys worker -l info
33 36 volumes_from:
34 37 - web
35 38 depends_on:
36 39 - web
37 40
38 41 # PostgreSQL
39 42 postgres:
40 43 container_name: 'radarsys-postgres'
41 44 build: ./postgres/
42 45 volumes:
43 46 - ./postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
44 47 - pgdata:/var/lib/postgresql/data
45 48 env_file: .env
46 49
47 50 # Web Server
48 51 nginx:
49 52 container_name: 'radarsys-nginx'
50 53 restart: always
51 54 build: ./nginx/
52 55 ports:
53 56 - '8030:8030'
54 57 volumes_from:
55 58 - web
56 59 links:
57 60 - web:web
58 61 depends_on:
59 62 - web
60 63
61 64 volumes:
62 65 pgdata:
63 66 driver: local
@@ -1,136 +1,136
1 1 """
2 2 Django settings for radarsys project.
3 3
4 4 Generated by 'django-admin startproject' using Django 1.8.6.
5 5
6 6 For more information on this file, see
7 7 https://docs.djangoproject.com/en/1.8/topics/settings/
8 8
9 9 For the full list of settings and their values, see
10 10 https://docs.djangoproject.com/en/1.8/ref/settings/
11 11 """
12 12
13 13 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
14 14 import os
15 15
16 16 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 17
18 18 # Quick-start development settings - unsuitable for production
19 19 # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
20 20
21 21 # SECURITY WARNING: keep the secret key used in production secret!
22 22 SECRET_KEY = 'xshb$k5fc-+j16)cvyffj&9u__0q3$l!hieh#+tbzqg)*f^km0'
23 23
24 24 # SECURITY WARNING: don't run with debug turned on in production!
25 25 DEBUG = True
26 26
27 27 ALLOWED_HOSTS = ['*']
28 28
29 29 # Application definition
30 30
31 31 INSTALLED_APPS = (
32 32 'django.contrib.admin',
33 33 'django.contrib.auth',
34 34 'django.contrib.contenttypes',
35 35 'django.contrib.sessions',
36 36 'django.contrib.messages',
37 37 'django.contrib.staticfiles',
38 38 'bootstrap3',
39 39 'polymorphic',
40 40 'apps.accounts',
41 41 'apps.main',
42 42 'apps.misc',
43 43 'apps.rc',
44 44 'apps.dds',
45 45 'apps.jars',
46 46 'apps.usrp',
47 47 'apps.abs',
48 48 'apps.cgs',
49 49 )
50 50
51 51 MIDDLEWARE_CLASSES = (
52 52 'django.contrib.sessions.middleware.SessionMiddleware',
53 53 'django.middleware.common.CommonMiddleware',
54 54 'django.middleware.csrf.CsrfViewMiddleware',
55 55 'django.contrib.auth.middleware.AuthenticationMiddleware',
56 56 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
57 57 'django.contrib.messages.middleware.MessageMiddleware',
58 58 'django.middleware.clickjacking.XFrameOptionsMiddleware',
59 59 'django.middleware.security.SecurityMiddleware',
60 60 )
61 61
62 62 ROOT_URLCONF = 'radarsys.urls'
63 63
64 64 TEMPLATES = [
65 65 {
66 66 'BACKEND': 'django.template.backends.django.DjangoTemplates',
67 67 'DIRS': [os.path.join(BASE_DIR, "templates").replace('\\', '/'),],
68 68 'APP_DIRS': True,
69 69 'OPTIONS': {
70 70 'context_processors': [
71 71 'django.template.context_processors.debug',
72 72 'django.template.context_processors.request',
73 73 'django.contrib.auth.context_processors.auth',
74 74 'django.contrib.messages.context_processors.messages',
75 75 ],
76 76 },
77 77 },
78 78 ]
79 79
80 80 WSGI_APPLICATION = 'radarsys.wsgi.application'
81 81
82 82
83 83 # Database
84 84 # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
85 85
86 86 DATABASES = {
87 87 'default': {
88 88 'ENGINE': 'django.db.backends.postgresql_psycopg2',
89 89 'NAME': os.environ.get('POSTGRES_DB_NAME', 'radarsys'),
90 90 'USER': os.environ.get('POSTGRES_USER', 'docker'),
91 91 'PASSWORD': os.environ.get('POSTGRES_PASSWORD', 'docker'),
92 92 'HOST': os.environ.get('POSTGRES_PORT_5432_TCP_ADDR', 'postgres'),
93 93 'PORT': os.environ.get('POSTGRES_PORT_5432_TCP_PORT', ''),
94 94 }
95 95 }
96 96
97 97 # Internationalization
98 98 # https://docs.djangoproject.com/en/1.8/topics/i18n/
99 99
100 100 LANGUAGE_CODE = 'en-us'
101 101
102 TIME_ZONE = None
102 TIME_ZONE = os.environ.get('TZ', 'UTC')
103 103
104 104 USE_I18N = True
105 105
106 106 USE_L10N = True
107 107
108 108 USE_TZ = False
109 109
110 110 # Static files (CSS, JavaScript, Images)
111 111 # https://docs.djangoproject.com/en/1.8/howto/static-files/
112 112
113 113 MEDIA_URL = '/media/'
114 114 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
115 115
116 116 STATIC_URL = '/static/'
117 117 STATIC_ROOT = os.path.join(BASE_DIR, 'static')
118 118
119 119 STATICFILES_FINDERS = (
120 120 'django.contrib.staticfiles.finders.FileSystemFinder',
121 121 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
122 122 )
123 123
124 124 # Celery stuff
125 125 REDIS_HOST = os.environ.get('REDIS_HOST', '127.0.0.1')
126 126 REDIS_PORT = os.environ.get('REDIS_PORT', 6379)
127 127
128 128 BROKER_TRANSPORT = 'redis'
129 129 BROKER_URL = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT)
130 130
131 131 CELERY_RESULT_BACKEND = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT)
132 132 CELERY_BROKER_TRANSPORT = BROKER_URL
133 133 CELERY_ACCEPT_CONTENT = ['application/json']
134 134 CELERY_TASK_SERIALIZER = 'json'
135 135 CELERY_RESULT_SERIALIZER = 'json'
136 CELERY_TIMEZONE = 'America/Lima'
136 CELERY_ENABLE_UTC = False No newline at end of file
@@ -1,12 +1,12
1 1 Django==1.10.1
2 2 django-bootstrap3
3 psycopg2
4 django-polymorphic
3 psycopg2-binary
4 django-polymorphic==1.3
5 5 bokeh==0.12.1
6 6 numpy==1.13.3
7 7 matplotlib
8 8 scipy
9 9 celery
10 10 gunicorn
11 11 requests
12 12 redis No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now