- Start the docker DB container
docker compose -f db.compose.yml up --build
- Start the backend
python manage.py runserver
- Make sure that there a file called
.env.prod
in the root directory of the project that contains the environment variables for the production environment, here is an example of the file:
# DB container envs
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=DB
POSTGRES_PASSWORD='xxx'
POSTGRES_NAME=logs_db
# django container envs
DJANGO_ENV=production
DEBUG=True
SECRET_KEY='xxx'
- Start docker compose
docker compose up --build
- Navigate to the root directory of the project
cd /var/www/logs-sports
- Stop the docker compose
docker compose down
- Pull the latest changes from the repository
git pull
- Start docker compose
docker compose up --build -d