-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devops(deploy): configura o ambiente de deploy para o heroku (#131)
* devops(docker): muda entrypoint de pasta * devops(requirements): adiciona deps de produção Co-authored-by: HenrikhKenino <[email protected]> * devops(make): arruma caminho do entrypoint * devops(heroku): arquivos de config do deploy * devops(heroku): separa arquivos de config dev/prod Co-authored-by: HenrikhKenino <[email protected]> * devops(heroku): configura domínios permitidos Co-authored-by: HenrikhKenino <[email protected]> * devops(core): add redirect ssl to django Co-authored-by: HenrikhKenino <[email protected]> * devops(updatedb): cria melhor descrição de erro * docs(executing): docs seguir novo padrão de pastas * git(workflows): adiciona nomes aos jobs do actions --------- Co-authored-by: HenrikhKenino <[email protected]>
- Loading branch information
1 parent
ea60e9e
commit 14acfe6
Showing
15 changed files
with
141 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ permissions: | |
|
||
jobs: | ||
docs: | ||
name: mkdocs deploy | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ permissions: | |
|
||
jobs: | ||
test: | ||
name: api test coverage | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
release: python3 manage.py migrate | ||
web: gunicorn core.wsgi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,31 @@ | ||
from .base import * | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = True | ||
|
||
ALLOWED_HOSTS = [ | ||
"localhost", | ||
"0.0.0.0", | ||
"127.0.0.1" | ||
] | ||
|
||
# django-cors-headers | ||
# https://github.com/adamchainz/django-cors-headers | ||
|
||
CORS_ALLOW_ALL_ORIGINS = True | ||
CORS_ALLOW_CREDENTIALS = True | ||
|
||
|
||
# Database | ||
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': BASE_DIR / 'db.sqlite3', | ||
"default": { | ||
"ENGINE": "django.db.backends.postgresql", | ||
"NAME": config("DB_NAME"), | ||
"USER": config("DB_USERNAME"), | ||
"PASSWORD": config("DB_PASSWORD"), | ||
"HOST": config("DB_HOSTNAME"), | ||
"PORT": config("DB_PORT", cast=int), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,60 @@ | ||
from .base import * | ||
|
||
import dj_database_url | ||
|
||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = False | ||
|
||
ALLOWED_HOSTS = ["0.0.0.0:8000", "localhost:8000", "127.0.0.1:8000"] | ||
ALLOWED_HOSTS = [ | ||
".herokuapp.com", | ||
".suagradeunb.com.br" | ||
] | ||
|
||
|
||
# django-cors-headers | ||
# https://github.com/adamchainz/django-cors-headers | ||
|
||
CORS_ALLOWED_ORIGINS = [ | ||
"https://suagradeunb.com.br", | ||
"https://api.suagradeunb.com.br" | ||
] | ||
# CORS_ALLOW_ALL_ORIGINS = True | ||
CORS_ALLOW_CREDENTIALS = True | ||
|
||
|
||
# SSL Redirect | ||
|
||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') | ||
SECURE_SSL_REDIRECT = True | ||
|
||
|
||
# Application definition | ||
|
||
INSTALLED_APPS.insert(0, "whitenoise.runserver_nostatic") | ||
|
||
MIDDLEWARE.insert(1, "whitenoise.middleware.WhiteNoiseMiddleware") | ||
|
||
|
||
# Database | ||
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases | ||
|
||
DATABASES = { | ||
"default": dj_database_url.config( | ||
conn_max_age=600, | ||
conn_health_checks=True, | ||
ssl_require=True, | ||
), | ||
} | ||
|
||
STORAGES = { | ||
# Enable WhiteNoise's GZip and Brotli compression of static assets: | ||
# https://whitenoise.readthedocs.io/en/latest/django.html#add-compression-and-caching-support | ||
"staticfiles": { | ||
"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", | ||
}, | ||
} | ||
|
||
# Don't store the original (un-hashed filename) version of static files, to reduce slug size: | ||
# https://whitenoise.readthedocs.io/en/latest/django.html#WHITENOISE_KEEP_ONLY_HASHED_FILES | ||
WHITENOISE_KEEP_ONLY_HASHED_FILES = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python-3.11.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.