clean up stage configs, start of live configs
This commit is contained in:
parent
496f6ad8d7
commit
223de57b6b
|
@ -2,15 +2,11 @@
|
||||||
"""
|
"""
|
||||||
Production Configurations
|
Production Configurations
|
||||||
|
|
||||||
- Use Amazon's S3 for storing static files and uploaded media
|
|
||||||
- Use mailgun to send emails
|
|
||||||
- Use Redis for cache
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from boto.s3.connection import OrdinaryCallingFormat
|
|
||||||
from django.utils import six
|
from django.utils import six
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,7 +74,6 @@ AWS_SECRET_ACCESS_KEY = env('DJANGO_AWS_SECRET_ACCESS_KEY')
|
||||||
AWS_STORAGE_BUCKET_NAME = env('DJANGO_AWS_STORAGE_BUCKET_NAME')
|
AWS_STORAGE_BUCKET_NAME = env('DJANGO_AWS_STORAGE_BUCKET_NAME')
|
||||||
AWS_AUTO_CREATE_BUCKET = True
|
AWS_AUTO_CREATE_BUCKET = True
|
||||||
AWS_QUERYSTRING_AUTH = False
|
AWS_QUERYSTRING_AUTH = False
|
||||||
AWS_S3_CALLING_FORMAT = OrdinaryCallingFormat()
|
|
||||||
|
|
||||||
# AWS cache settings, don't change unless you know what you're doing:
|
# AWS cache settings, don't change unless you know what you're doing:
|
||||||
AWS_EXPIRY = 60 * 60 * 24 * 7
|
AWS_EXPIRY = 60 * 60 * 24 * 7
|
||||||
|
@ -93,7 +88,7 @@ AWS_HEADERS = {
|
||||||
|
|
||||||
# URL that handles the media served from MEDIA_ROOT, used for managing
|
# URL that handles the media served from MEDIA_ROOT, used for managing
|
||||||
# stored files.
|
# stored files.
|
||||||
MEDIA_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME
|
# MEDIA_URL = ''
|
||||||
|
|
||||||
|
|
||||||
# Static Assets
|
# Static Assets
|
||||||
|
@ -108,17 +103,25 @@ COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
|
||||||
# EMAIL
|
# EMAIL
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL',
|
DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL',
|
||||||
default='Maidstone Hackspace <noreply@maidstone-hackspace.org.uk>')
|
default='Maidstone Hackspace <no-reply@maidstone-hackspace.org.uk>')
|
||||||
EMAIL_SUBJECT_PREFIX = env('DJANGO_EMAIL_SUBJECT_PREFIX', default='[Maidstone Hackspace] ')
|
EMAIL_SUBJECT_PREFIX = env('DJANGO_EMAIL_SUBJECT_PREFIX', default='[Maidstone Hackspace] ')
|
||||||
SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', default=DEFAULT_FROM_EMAIL)
|
SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', default=DEFAULT_FROM_EMAIL)
|
||||||
|
SERVER_EMAIL_PORT = '587'
|
||||||
|
|
||||||
|
EMAIL_USE_TLS = True
|
||||||
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
|
EMAIL_HOST = 'smtp.gmail.com'
|
||||||
|
EMAIL_HOST_PASSWORD = env('EMAIL_PASSWORD')
|
||||||
|
EMAIL_HOST_USER = env('EMAIL_USER')
|
||||||
|
EMAIL_PORT = 587
|
||||||
|
|
||||||
# Anymail with Mailgun
|
# Anymail with Mailgun
|
||||||
INSTALLED_APPS += ("anymail", )
|
#INSTALLED_APPS += ("anymail", )
|
||||||
ANYMAIL = {
|
#ANYMAIL = {
|
||||||
"MAILGUN_API_KEY": env('DJANGO_MAILGUN_API_KEY'),
|
# "MAILGUN_API_KEY": env('DJANGO_MAILGUN_API_KEY'),
|
||||||
"MAILGUN_SENDER_DOMAIN": env('MAILGUN_SENDER_DOMAIN')
|
# "MAILGUN_SENDER_DOMAIN": env('MAILGUN_SENDER_DOMAIN')
|
||||||
}
|
#}
|
||||||
EMAIL_BACKEND = "anymail.backends.mailgun.MailgunBackend"
|
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
|
||||||
|
|
||||||
# TEMPLATE CONFIGURATION
|
# TEMPLATE CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -187,23 +190,28 @@ LOGGING = {
|
||||||
'class': 'logging.StreamHandler',
|
'class': 'logging.StreamHandler',
|
||||||
'formatter': 'verbose',
|
'formatter': 'verbose',
|
||||||
},
|
},
|
||||||
|
'logfile': {
|
||||||
|
'level':'DEBUG',
|
||||||
|
'class':'logging.FileHandler',
|
||||||
|
'filename': "%s/django.log" % ROOT_DIR,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
'loggers': {
|
'loggers': {
|
||||||
'django.request': {
|
'django.request': {
|
||||||
'handlers': ['mail_admins'],
|
'handlers': ['mail_admins', 'logfile'],
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'propagate': True
|
'propagate': True
|
||||||
},
|
},
|
||||||
'django.security.DisallowedHost': {
|
'django.security.DisallowedHost': {
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'handlers': ['console', 'mail_admins'],
|
'handlers': ['logfile', 'console', 'mail_admins'],
|
||||||
'propagate': True
|
'propagate': True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Custom Admin URL, use {% url 'admin:index' %}
|
# Custom Admin URL, use {% url 'admin:index' %}
|
||||||
ADMIN_URL = env('DJANGO_ADMIN_URL')
|
ADMIN_URL = env('DJANGO_ADMIN_URL', default='admin')
|
||||||
|
|
||||||
# Your production stuff: Below this line define 3rd party library settings
|
# Your production stuff: Below this line define 3rd party library settings
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""
|
||||||
Production Configurations
|
Stage Configurations
|
||||||
|
|
||||||
- Use mailgun to send emails
|
|
||||||
- Use Redis for cache
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
52
live.yml
52
live.yml
|
@ -1,55 +1,43 @@
|
||||||
version: '2'
|
version: '2'
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
gunicorn_socket: {}
|
sockets:
|
||||||
postgres_data_dev: {}
|
external: true
|
||||||
postgres_backup_dev: {}
|
postgres_data:
|
||||||
|
driver: local
|
||||||
|
postgres_backup:
|
||||||
|
driver: local
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
build: ./compose/postgres
|
build: ./compose/postgres
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data_dev:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
- postgres_backup_dev:/backups
|
- postgres_backup:/backups
|
||||||
# environment:
|
|
||||||
# - POSTGRES_USER=${POSTGRES_USER}
|
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
|
||||||
django:
|
django:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./compose/django/Dockerfile
|
dockerfile: ./compose/django/Dockerfile
|
||||||
command: /start-dev.sh
|
user: django
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
environment:
|
- redis
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
command: /gunicorn.sh
|
||||||
- USE_DOCKER=yes
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
- gunicorn_socket:/var/run/gunicorn/
|
- sockets:/data/sockets
|
||||||
ports:
|
|
||||||
- "8180:8000"
|
|
||||||
links:
|
|
||||||
- postgres
|
|
||||||
- mailhog
|
|
||||||
|
|
||||||
nginx:
|
|
||||||
build: ./compose/nginx
|
|
||||||
depends_on:
|
node:
|
||||||
- django
|
image: node:7-onbuild
|
||||||
environment:
|
command: npm install
|
||||||
- MY_DOMAIN_NAME=maidstone-hackspace.org.uk
|
|
||||||
ports:
|
|
||||||
- "0.0.0.0:80:80"
|
|
||||||
# - "0.0.0.0:443:443"
|
|
||||||
volumes:
|
volumes:
|
||||||
- gunicorn_socket:/var/run/gunicorn/
|
- ./:/usr/src/app
|
||||||
|
|
||||||
mailhog:
|
|
||||||
image: mailhog/mailhog
|
|
||||||
ports:
|
|
||||||
- "8125:8025"
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:latest
|
image: redis:latest
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% get_static_prefix as STATIC_PREFIX %}
|
{% get_static_prefix as STATIC_PREFIX %}
|
||||||
|
|
||||||
<h3 class="mb-1">See what our memberrs have been creating below.</h3>
|
<h3 class="mb-1">See what our members have been creating below.</h3>
|
||||||
<br />
|
<br />
|
||||||
<div class="card-columns" id="feeds">
|
<div class="card-columns" id="feeds">
|
||||||
<div class="card-deck">
|
<div class="card-deck">
|
||||||
|
|
38
stage.yml
38
stage.yml
|
@ -8,14 +8,6 @@ volumes:
|
||||||
postgres_backup:
|
postgres_backup:
|
||||||
driver: local
|
driver: local
|
||||||
|
|
||||||
|
|
||||||
# volumes:
|
|
||||||
# sockets:
|
|
||||||
# driver: local
|
|
||||||
# data:
|
|
||||||
# driver: local
|
|
||||||
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
build: ./compose/postgres
|
build: ./compose/postgres
|
||||||
|
@ -38,37 +30,7 @@ services:
|
||||||
- .:/app
|
- .:/app
|
||||||
- sockets:/data/sockets
|
- sockets:/data/sockets
|
||||||
|
|
||||||
# nginx:
|
|
||||||
# build: ./compose/nginx
|
|
||||||
# env_file: .env
|
|
||||||
# depends_on:
|
|
||||||
# - django
|
|
||||||
# - certbot
|
|
||||||
#
|
|
||||||
# environment:
|
|
||||||
# - MY_DOMAIN_NAME=test.maidstone-hackspace.org.uk
|
|
||||||
# ports:
|
|
||||||
# - "0.0.0.0:8080:80"
|
|
||||||
# volumes:
|
|
||||||
# - .:/app
|
|
||||||
# - sockets:/data/sockets
|
|
||||||
# - "0.0.0.0:443:443"
|
|
||||||
# volumes:
|
|
||||||
# - /etc/letsencrypt:/etc/letsencrypt
|
|
||||||
# - /var/lib/letsencrypt:/var/lib/letsencrypt
|
|
||||||
|
|
||||||
# certbot:
|
|
||||||
# image: quay.io/letsencrypt/letsencrypt
|
|
||||||
# command: bash -c "sleep 6 && certbot certonly -n --standalone -d maidstone-hackspace.org.uk --text --agree-tos --email support@maidstone-hackspace.org.uk --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --standalone-supported-challenges http-01"
|
|
||||||
# entrypoint: ""
|
|
||||||
# volumes:
|
|
||||||
# - /etc/letsencrypt:/etc/letsencrypt
|
|
||||||
# - /var/lib/letsencrypt:/var/lib/letsencrypt
|
|
||||||
# ports:
|
|
||||||
# - "80"
|
|
||||||
# - "443"
|
|
||||||
# environment:
|
|
||||||
# - TERM=xterm
|
|
||||||
|
|
||||||
node:
|
node:
|
||||||
image: node:7-onbuild
|
image: node:7-onbuild
|
||||||
|
|
Loading…
Reference in New Issue