π³ Koyeb_FInMK: Beginner's Docker Setup Guide
Welcome! This guide will take you from a fresh clone of the repository to a fully running, containerized version of Koyeb_FInMK (Django Backend + React Frontend + MongoDB Atlas).
π Prerequisites
Before you begin, ensure you have the following installed on your computer:
- Docker Desktop: Download for Windows/Mac
- Git: Download Git
- MongoDB Atlas Account: A free cloud database. (The pre-configured
.envuses a demo cluster, but you should create your own for privacy).
π Step-by-Step Installation
1. Clone the Repository
Open your terminal (Command Prompt or PowerShell on Windows) and run:
git clone https://github.com/Manikumar4/Koyeb_FInMK.git
cd Koyeb_FInMK
2. Configure Environment Variables
The application needs some "secrets" to run.
- Navigate to the
backendfolder. - Ensure there is a file named
.env. - If it's missing, create it and paste the following (replace placeholder values with your real keys):
ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0
DB_NAME=finance
DEBUG=True
ENVIRONMENT=development
GEMINI_API_KEY=your_gemini_key_here
MONGODB_URI=your_mongodb_atlas_uri_here
OPENROUTER_API_KEY=your_openrouter_key_here
SECRET_KEY=generate_a_random_secret_string_here
3. Build and Run with Docker
This is the "magic" step that sets everything up automatically. Back in the root folder (Koyeb_FInMK), run:
docker-compose up --build
The first time you run this, it will take 5-10 minutes because it needs to download and install heavy libraries like NumPy and Pandas. Subsequent runs will take only seconds!
π Accessing the Application
Once you see logs appearing in your terminal without errors, your app is live!
- Frontend UI: http://localhost (Open this in your browser)
- Backend API: http://localhost/api/
- Django Admin: http://localhost/admin/
π οΈ Troubleshooting & Common Issues
β "Port 80 is already in use"
This happens if you have another web server (like IIS or Apache) running.
- Fix: Open
docker-compose.ymland change"80:80"underfrontendto"8080:80". Then usehttp://localhost:8080.
β Python version errors during build
Make sure you are using the latest Dockerfile provided in this setup. We use Python 3.11-slim for the backend to ensure compatibility with all data science libraries.
β "Module not found" in Frontend
If the frontend fails to build, it might be due to an old Node.js version in simple Dockerfiles. This project uses Node 20-alpine specifically to support Vite 7.
π How to Stop
To shut down the application, press Ctrl + C in your terminal, or run:
docker-compose down
Happy Coding! π