Backend python code
Clone the project from Github:
Project Root Directory: `/var/www`
git clone remote url
Build a container
docker compose build
Run bash in container (required* postgres and redis on host)
docker run -it --env-file .env -v ./mysite:/webapp --network=host vaibhavbhwsr/fireshine_dev_image bash
To reconnect container
docker attach <container-id>
note*: .env file is required
docker compose -f docker-compose.prod.yaml up --build
Create Virtualenv Folder
virtualenv --python=python3.8 Project_dir/.venv
Activate Environment:
source project_venv/bin/activate
Install Packages:
pip install -r mysite/requirements.txt
See example.ini
note*: create postgres database named mysitedb then run commands in environment.
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py createsuperuser
Use MODE=dev in local only else on server it requires static and media file and stop S3 bucket to use