1
0
Fork 0

Minor simplifications on docker and opbeat

merge-requests/217/head
Nikos Roussos 2018-03-24 15:36:52 +02:00
parent b8a51dda47
commit 6fa7dc9e00
No known key found for this signature in database
GPG Key ID: BADFF1767BA7C8E1
3 changed files with 22 additions and 17 deletions

View File

@ -2,5 +2,6 @@
find ./staticfiles -mindepth 1 -not -name '.gitkeep'| xargs rm -rf
./manage.py collectstatic --noinput
./manage.py compress --force
./manage.py migrate --noinput
./manage.py runserver 0.0.0.0:8000

View File

@ -28,17 +28,19 @@ THIRD_PARTY_APPS = (
'crispy_forms',
'compressor',
'csp',
'opbeat.contrib.django',
)
LOCAL_APPS = (
'db.base',
'db.api',
)
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
if ENVIRONMENT == 'production':
INSTALLED_APPS += (
'opbeat.contrib.django',
)
# Middlware
MIDDLEWARE_CLASSES = (
MIDDLEWARE = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
@ -46,9 +48,12 @@ MIDDLEWARE_CLASSES = (
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'csp.middleware.CSPMiddleware',
'opbeat.contrib.django.middleware.OpbeatAPMMiddleware',
'opbeat.contrib.django.middleware.Opbeat404CatchMiddleware',
)
if ENVIRONMENT == 'production':
MIDDLEWARE += (
'opbeat.contrib.django.middleware.OpbeatAPMMiddleware',
'opbeat.contrib.django.middleware.Opbeat404CatchMiddleware',
)
# Email
if DEBUG:

View File

@ -1,36 +1,41 @@
version: '3'
version: '3.1'
services:
db:
image: mariadb:5.5
container_name: satnogs_db_mysql
environment:
- MYSQL_DATABASE=satnogsdb
- MYSQL_USER=satnogsdb
- MYSQL_PASSWORD=satnogsdb
- MYSQL_ROOT_PASSWORD=toor
redis:
image: redis:3.2.8
container_name: satnogs_db_redis
celery:
build:
context: .
dockerfile: docker/dev
container_name: satnogs_db_celery
volumes:
- .:/app
links:
- db
- redis
environment:
- ENVIRONMENT=dev
- DEBUG=True
- DATABASE_URL=mysql://satnogsdb:satnogsdb@db/satnogsdb
- CACHE_BACKEND=redis_cache.RedisCache
- CACHE_LOCATION=redis://redis:6379/1
- CACHE_CLIENT_CLASS=django_redis.client.DefaultClient
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
command:
./bin/run-celery.sh
web:
build:
context: .
dockerfile: docker/dev
container_name: satnogs_db_web
ports:
- "8000:8000"
volumes:
@ -38,13 +43,7 @@ services:
links:
- db
- redis
- celery
environment:
- ENVIRONMENT=dev
- DEBUG=True
- DATABASE_URL=mysql://satnogsdb:satnogsdb@db/satnogsdb
- CACHE_BACKEND=redis_cache.RedisCache
- CACHE_LOCATION=redis://redis:6379/1
- CACHE_CLIENT_CLASS=django_redis.client.DefaultClient
command:
./bin/run-web.sh