local dev env
This commit is contained in:
parent
029665145e
commit
04cd8ce55c
51
cms/dev_settings.py
Normal file
51
cms/dev_settings.py
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
# Development settings, mainly used in docker-compose-dev.yaml
|
||||||
|
# Django runs in debug mode with runserver, uwsgi and nginx arenot loaded
|
||||||
|
# Django static loads everything from static/ folder
|
||||||
|
import os
|
||||||
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
|
INSTALLED_APPS = [
|
||||||
|
'django.contrib.admin',
|
||||||
|
'django.contrib.auth',
|
||||||
|
'allauth',
|
||||||
|
'allauth.account',
|
||||||
|
'allauth.socialaccount',
|
||||||
|
'django.contrib.contenttypes',
|
||||||
|
'django.contrib.sessions',
|
||||||
|
'django.contrib.messages',
|
||||||
|
'django.contrib.staticfiles',
|
||||||
|
'django.contrib.sites',
|
||||||
|
'rest_framework',
|
||||||
|
'rest_framework.authtoken',
|
||||||
|
'imagekit',
|
||||||
|
'files.apps.FilesConfig',
|
||||||
|
'users.apps.UsersConfig',
|
||||||
|
'actions.apps.ActionsConfig',
|
||||||
|
'debug_toolbar',
|
||||||
|
'mptt',
|
||||||
|
'crispy_forms',
|
||||||
|
'uploader.apps.UploaderConfig',
|
||||||
|
'djcelery_email',
|
||||||
|
'ckeditor',
|
||||||
|
'drf_yasg',
|
||||||
|
'corsheaders'
|
||||||
|
]
|
||||||
|
|
||||||
|
MIDDLEWARE = [
|
||||||
|
'corsheaders.middleware.CorsMiddleware',
|
||||||
|
'django.middleware.security.SecurityMiddleware',
|
||||||
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||||
|
]
|
||||||
|
|
||||||
|
DEBUG = True
|
||||||
|
CORS_ORIGIN_ALLOW_ALL = True
|
||||||
|
STATICFILES_DIRS = (
|
||||||
|
os.path.join(BASE_DIR, 'static/'),
|
||||||
|
)
|
||||||
|
STATIC_ROOT = None
|
|
@ -487,3 +487,14 @@ if GLOBAL_LOGIN_REQUIRED:
|
||||||
]
|
]
|
||||||
|
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
# mostly used in docker-compose-dev.yaml
|
||||||
|
DEVELOPMENT_MODE = os.environ.get("DEVELOPMENT_MODE")
|
||||||
|
if DEVELOPMENT_MODE:
|
||||||
|
# keep a dev_settings.py file for local overrides
|
||||||
|
from .dev_settings import * # noqa
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,30 @@
|
||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
migrations:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: ./Dockerfile-dev
|
||||||
|
image: mediacms/mediacms-dev:latest
|
||||||
|
volumes:
|
||||||
|
- ./:/home/mediacms.io/mediacms/
|
||||||
|
environment:
|
||||||
|
ENABLE_UWSGI: 'no'
|
||||||
|
ENABLE_NGINX: 'no'
|
||||||
|
ENABLE_CELERY_SHORT: 'no'
|
||||||
|
ENABLE_CELERY_LONG: 'no'
|
||||||
|
ENABLE_CELERY_BEAT: 'no'
|
||||||
|
ADMIN_USER: 'admin'
|
||||||
|
ADMIN_EMAIL: 'admin@localhost'
|
||||||
|
#ADMIN_PASSWORD: 'uncomment_and_set_password_here'
|
||||||
|
command: "./deploy/docker/prestart.sh"
|
||||||
|
restart: on-failure
|
||||||
|
depends_on:
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: node:14
|
image: node:14
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -18,7 +42,9 @@ services:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./Dockerfile-dev
|
dockerfile: ./Dockerfile-dev
|
||||||
image: mediacms/mediacms-dev:latest
|
image: mediacms/mediacms-dev:latest
|
||||||
|
command: "python manage.py runserver 0.0.0.0:80"
|
||||||
environment:
|
environment:
|
||||||
|
DEVELOPMENT_MODE: "True"
|
||||||
ADMIN_USER: 'admin'
|
ADMIN_USER: 'admin'
|
||||||
ADMIN_PASSWORD: 'admin'
|
ADMIN_PASSWORD: 'admin'
|
||||||
ADMIN_EMAIL: 'admin@localhost'
|
ADMIN_EMAIL: 'admin@localhost'
|
||||||
|
@ -54,3 +80,16 @@ services:
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
celery_worker:
|
||||||
|
image: mediacms/mediacms-dev:latest
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
volumes:
|
||||||
|
- ./:/home/mediacms.io/mediacms/
|
||||||
|
environment:
|
||||||
|
ENABLE_UWSGI: 'no'
|
||||||
|
ENABLE_NGINX: 'no'
|
||||||
|
ENABLE_CELERY_BEAT: 'no'
|
||||||
|
ENABLE_MIGRATIONS: 'no'
|
||||||
|
depends_on:
|
||||||
|
- web
|
||||||
|
|
|
@ -12,3 +12,6 @@ pytest-cov
|
||||||
pytest-django
|
pytest-django
|
||||||
pytest-factoryboy
|
pytest-factoryboy
|
||||||
Faker
|
Faker
|
||||||
|
whitenoise
|
||||||
|
django-cors-headers
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue