The application reads the following variables to connect to MySQL. Defaults match the values used in docker-compose.yml.
Variable
Default
Description
DB_NAME
tfg
Database name
DB_USER
tfg
Database user
DB_PASSWORD
tfg
Database password
DB_HOST
db
Database host
DB_PORT
3306
Database port
The default SECRET_KEY in config/settings.py and the credentials above are for development only. Replace them before deploying to any public environment.
The default command in docker-compose.yml is sleep infinity, which keeps the container running without starting the server. Override it or exec into the container to run the application manually (see next step).
3
Start the services
docker compose up --build
Docker Compose waits for the database health check to pass before starting the application container.
4
Run migrations and start the server
The Dockerfile’s default command runs migrations and starts the development server: