Commit e241a74b authored by Horacio Castellaro's avatar Horacio Castellaro
Browse files

New Tag 1.1.1 with ssl changes

No related merge requests found
Showing with 48 additions and 30 deletions
+48 -30
......@@ -5,7 +5,8 @@ services:
build: ./src
container_name: django_data_manager
command: bash -c "python manage.py migrate
&& python manage.py runserver 0.0.0.0:8000"
&& gunicorn config.wsgi:application --bind 0.0.0.0:8000"
# && python manage.py runserver 0.0.0.0:8000"
volumes:
- ./src:/usr/src/app/
......@@ -36,7 +37,10 @@ services:
volumes:
- ./importer:/app/importer
- ./nginx/gestor.conf:/opt/bitnami/nginx/conf/server_blocks/gestor.conf:ro
# Descomentar lo siguiente para utilizar nginx con certificados propios
# - ./nginx/gestor.conf_ssl:/opt/bitnami/nginx/conf/server_blocks/gestor.conf:ro
# - ./certificates/key.key:/etc/nginx/key.key
# - ./certificates/cert.crt:/etc/nginx/cert.crt
restart: on-failure
volumes:
......
server {
listen 0.0.0.0:80;
server_name data_manager.com;
server_name _;
#access_log /opt/bitnami/nginx/logs/yourapp_access.log;
#error_log /opt/bitnami/nginx/logs/yourapp_error.log;
......
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name _;
ssl_certificate cert.crt;
ssl_certificate_key key.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
#access_log /opt/bitnami/nginx/logs/yourapp_access.log;
#error_log /opt/bitnami/nginx/logs/yourapp_error.log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header HOST $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://django:8000;
proxy_redirect off;
}
location /importer {
root /app;
index index.html;
}
}
SECRET_KEY=mi_secret_key
ALLOWED_HOSTS='sgo-ub20-geo-d1.cepal.org, localhost, 127.0.0.1'
DJANGO_SETTINGS_MODULE=config.settings.prod_settings
DATABASE_URL=postgres://postgres:postgres@db:5432/data_manager
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=data_manager
CONTEXT="public"
ENVIRONMENT=""
MACHINE="demo"
HOST=""
APP_NAME="Gestor de datos estadísticos"
APP_VERSION="1.0"
SHOW_ENDPOINT=True
SHOW_ENVIRONMENT=True
SHOW_MACHINE=True
SHOW_CONTEXT=True
......@@ -166,3 +166,4 @@ SHOW_ENDPOINT = env.bool('SHOW_ENDPOINT', False)
SHOW_ENVIRONMENT = env.bool('SHOW_ENVIRONMENT', False)
SHOW_MACHINE = env.bool('SHOW_MACHINE', False)
SHOW_CONTEXT = env.bool('SHOW_CONTEXT', False)
CORS_ORIGIN_ALLOW_ALL = True
......@@ -14,9 +14,11 @@ STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STATICFILES_DIRS = []
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
SECURE_SSL_REDIRECT = True
SECURE_HSTS_SECONDS = 2_592_000
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_PRELOAD = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
#SECURE_SSL_REDIRECT = True
#SECURE_HSTS_SECONDS = 2_592_000
#SECURE_HSTS_INCLUDE_SUBDOMAINS = True
#SECURE_HSTS_PRELOAD = True
#SESSION_COOKIE_SECURE = True
#CSRF_COOKIE_SECURE = True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment