- Create a .env file in the same path as the Dockerfile
- The Content of the .env files are as:
DJANGO_SECRET_KEY
your django application secret keyDJANGO_DEBUG
as we are testing it should be likeDJANGO_DEBUG=True
DJANGO_ALLOWED_HOSTS
add the addresses u will allowDJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 0.0.0.0 <anything_here>
[::1]`POSTGRES_HOST
make this the database container service namePOSTGRES_NAME
your choicePOSTGRES_USER
your choicePOSTGRES_PASSWORD
your choiceGMAIL_ACC
andGMAIL_PW
set them to the account you want to send mail fromEMAIL_PORT
also define the email portEMAIL_USE_TLS
you can set this to any boolean valueEMAIL_HOST=smtp.gmail.com
you can select anything you wantEMAIL_VERIFICATION_OPTION=mandatory
choose your option from django provided optionsEMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
for smtp this requiresGMAIL_ACC
,GMAIL_PW
KHALTI_SECRET_KEY
use the SECRET_KEY Provided by KhaltiFRONT_END_URL
front-end url u want to map to
docker-compose up --build
to run the backend service
- Create a
.env-prod
file in the same path as the Dockerfile - include fields the same as above with
POSTGRES_HOST
name to container service namedb_prod
and all others docker-compose -f docker-compose-prod.yaml up --build
to run the backend and frontend with nginx gunicorn and all others