Docker Compose implementaion for Saatchi's project
- Backend: Django + Gunicorn
- Frontend: React
- Database: PostgreSQL
git clone <your-repo-url>
cd <project-folder>
Edit the following files before running:
backend/settings.py
- ALLOWED_HOSTS → include your domain or server IP
- CORS_ALLOWED_ORIGINS → add your frontend domain
docker-compose.yml
- Ensure database credentials in environment section match Django settings.
- set CORS_ALLOWED_ORIGINS
- set DJANGO_SUPERUSER_USERNAME and DJANGO_SUPERUSER_PASSWORD
Note
I am currently working on making those steps easier through env variables
docker compose up -d --build
This will start:
- PostgreSQL on port 5432
- Backend on port 8000
- Frontend on port 80
### 4.Run migrations & create superuser
Open a shell into the backend container:
docker compose exec backend python manage.py migrate
docker compose exec backend python manage.py createsuperuser
Note
This part will get automated to
Note
Done
- Frontend: http://localhost/
- Backend: http://localhost:8000/admin/
Tip
To change API base URL used by frontend, update frontend/src/links.jsx