diff --git a/DOCKER.md b/DOCKER.md new file mode 100644 index 0000000..af2afa5 --- /dev/null +++ b/DOCKER.md @@ -0,0 +1,67 @@ +# Running SystemCraft with Docker + +SystemCraft provides a fully configured Docker environment for easy local development, testing, and deployment. + +## Prerequisites + +Before getting started, ensure you have the following installed on your system: +- [Docker](https://docs.docker.com/get-docker/) +- [Docker Compose](https://docs.docker.com/compose/install/) + +You also must have your environment variables configured. Create a `.env` file in the root directory (you can copy the provided `.env.example` file and fill in your values). + +```bash +cp .env.example .env +``` + +--- + +## Quick Start + +### 1. Build and Start + +To build your containers and start the application in detached mode (running in the background), run: + +```bash +docker-compose up --build -d +``` + +### 2. Access the Application + +Once the containers are successfully running, the web application will be accessible in your localized environment. + +Open your browser and navigate to: +[http://localhost:3000](http://localhost:3000) + +--- + +## Useful Docker Commands + +Here are some helpful commands for managing your SystemCraft Docker environment: + +- **View live logs:** + ```bash + docker-compose logs -f + ``` + +- **Stop all containers:** + ```bash + docker-compose down + ``` + +- **Stop containers and remove associated volumes** (useful for a complete reset): + ```bash + docker-compose down -v + ``` + +- **Rebuild specific services without cache:** + ```bash + docker-compose build --no-cache + ``` + +--- + +## Troubleshooting + +- **Port Conflicts:** If `http://localhost:3000` is already in use by another application, you can modify the port mapping in the `docker-compose.yml` file under the `web` service ports configuration (e.g., `"8080:3000"`). +- **Environment Variables:** If you encounter authentication or database errors on boot, ensure your `.env` contains the required keys (`NEXT_PUBLIC_FIREBASE_API_KEY`, `MONGODB_URL`, etc.). The Docker configuration automatically injects these public variables at build time and secret variables at runtime. diff --git a/README.md b/README.md index 36e90fc..980ffe5 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ SystemCraft is a high-fidelity system design interview simulator. It combines an interactive architectural canvas with a sophisticated AI engine to evaluate your designs against real-world constraints, providing deep insights into trade-offs, scalability, and structural integrity. +[![Docker Setup Guide](https://img.shields.io/badge/Docker-Setup_Guide-2496ED?style=for-the-badge&logo=docker&logoColor=white)](./DOCKER.md) + --- ## Key Features @@ -55,6 +57,9 @@ NEXT_PUBLIC_FIREBASE_API_KEY=your_key npm run dev ``` +### 5. Running with Docker +Prefer containers? Check out our dedicated [Docker Setup Guide](./DOCKER.md) for quick-start instructions using Docker Compose. + --- ## 🛡️ Evaluation Engine