- Create a .env file in the same path as the Dockerfile
- The Content of the .env files are as:
DJANGO_SECRET_KEYyour django application secret keyDJANGO_DEBUGas we are testing it should be likeDJANGO_DEBUG=TrueDJANGO_ALLOWED_HOSTSadd the addresses u will allowDJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 0.0.0.0 <anything_here>[::1]`POSTGRES_HOSTmake this the database container service namePOSTGRES_NAMEyour choicePOSTGRES_USERyour choicePOSTGRES_PASSWORDyour choiceGMAIL_ACCandGMAIL_PWset them to the account you want to send mail fromEMAIL_PORTalso define the email portEMAIL_USE_TLSyou can set this to any boolean valueEMAIL_HOST=smtp.gmail.comyou can select anything you wantEMAIL_VERIFICATION_OPTION=mandatorychoose your option from django provided optionsEMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackendfor smtp this requiresGMAIL_ACC,GMAIL_PWKHALTI_SECRET_KEYuse the SECRET_KEY Provided by KhaltiFRONT_END_URLfront-end url u want to map to
docker-compose up --buildto run the backend service
- Create a
.env-prodfile in the same path as the Dockerfile - include fields the same as above with
POSTGRES_HOSTname to container service namedb_prodand all others docker-compose -f docker-compose-prod.yaml up --buildto run the backend and frontend with nginx gunicorn and all others