hillct commited on
Added Docker Deployment documentation to CONTRIBUTING.md
Browse files- CONTRIBUTING.md +86 -6
CONTRIBUTING.md
CHANGED
|
@@ -8,6 +8,7 @@ First off, thank you for considering contributing to Bolt.new! This fork aims to
|
|
| 8 |
- [Pull Request Guidelines](#pull-request-guidelines)
|
| 9 |
- [Coding Standards](#coding-standards)
|
| 10 |
- [Development Setup](#development-setup)
|
|
|
|
| 11 |
- [Project Structure](#project-structure)
|
| 12 |
|
| 13 |
## Code of Conduct
|
|
@@ -106,16 +107,95 @@ pnpm run deploy
|
|
| 106 |
|
| 107 |
Make sure you have the necessary permissions and Wrangler is correctly configured for your Cloudflare account.
|
| 108 |
|
| 109 |
-
#
|
| 110 |
|
| 111 |
-
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
```
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
```
|
| 116 |
|
| 117 |
-
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
```
|
| 120 |
-
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
- [Pull Request Guidelines](#pull-request-guidelines)
|
| 9 |
- [Coding Standards](#coding-standards)
|
| 10 |
- [Development Setup](#development-setup)
|
| 11 |
+
- [Deploymnt with Docker](#docker-deployment-documentation)
|
| 12 |
- [Project Structure](#project-structure)
|
| 13 |
|
| 14 |
## Code of Conduct
|
|
|
|
| 107 |
|
| 108 |
Make sure you have the necessary permissions and Wrangler is correctly configured for your Cloudflare account.
|
| 109 |
|
| 110 |
+
# Docker Deployment Documentation
|
| 111 |
|
| 112 |
+
This guide outlines various methods for building and deploying the application using Docker.
|
| 113 |
|
| 114 |
+
## Build Methods
|
| 115 |
+
|
| 116 |
+
### 1. Using Helper Scripts
|
| 117 |
+
|
| 118 |
+
NPM scripts are provided for convenient building:
|
| 119 |
+
|
| 120 |
+
```bash
|
| 121 |
+
# Development build
|
| 122 |
+
npm run dockerbuild
|
| 123 |
+
|
| 124 |
+
# Production build
|
| 125 |
+
npm run dockerbuild:prod
|
| 126 |
```
|
| 127 |
+
|
| 128 |
+
### 2. Direct Docker Build Commands
|
| 129 |
+
|
| 130 |
+
You can use Docker's target feature to specify the build environment:
|
| 131 |
+
|
| 132 |
+
```bash
|
| 133 |
+
# Development build
|
| 134 |
+
docker build . --target bolt-ai-development
|
| 135 |
+
|
| 136 |
+
# Production build
|
| 137 |
+
docker build . --target bolt-ai-production
|
| 138 |
```
|
| 139 |
|
| 140 |
+
### 3. Docker Compose with Profiles
|
| 141 |
|
| 142 |
+
Use Docker Compose profiles to manage different environments:
|
| 143 |
+
|
| 144 |
+
```bash
|
| 145 |
+
# Development environment
|
| 146 |
+
docker-compose --profile development up
|
| 147 |
+
|
| 148 |
+
# Production environment
|
| 149 |
+
docker-compose --profile production up
|
| 150 |
```
|
| 151 |
+
|
| 152 |
+
## Running the Application
|
| 153 |
+
|
| 154 |
+
After building using any of the methods above, run the container with:
|
| 155 |
+
|
| 156 |
+
```bash
|
| 157 |
+
# Development
|
| 158 |
+
docker run -p 5173:5173 --env-file .env.local bolt-ai:development
|
| 159 |
+
|
| 160 |
+
# Production
|
| 161 |
+
docker run -p 5173:5173 --env-file .env.local bolt-ai:production
|
| 162 |
+
```
|
| 163 |
+
|
| 164 |
+
## Deployment with Coolify
|
| 165 |
+
|
| 166 |
+
[Coolify](https://github.com/coollabsio/coolify) provides a straightforward deployment process:
|
| 167 |
+
|
| 168 |
+
1. Import your Git repository as a new project
|
| 169 |
+
2. Select your target environment (development/production)
|
| 170 |
+
3. Choose "Docker Compose" as the Build Pack
|
| 171 |
+
4. Configure deployment domains
|
| 172 |
+
5. Set the custom start command:
|
| 173 |
+
```bash
|
| 174 |
+
docker compose --profile production up
|
| 175 |
+
```
|
| 176 |
+
6. Configure environment variables
|
| 177 |
+
- Add necessary AI API keys
|
| 178 |
+
- Adjust other environment variables as needed
|
| 179 |
+
7. Deploy the application
|
| 180 |
+
|
| 181 |
+
## VS Code Integration
|
| 182 |
+
|
| 183 |
+
The `docker-compose.yaml` configuration is compatible with VS Code dev containers:
|
| 184 |
+
|
| 185 |
+
1. Open the command palette in VS Code
|
| 186 |
+
2. Select the dev container configuration
|
| 187 |
+
3. Choose the "development" profile from the context menu
|
| 188 |
+
|
| 189 |
+
## Environment Files
|
| 190 |
+
|
| 191 |
+
Ensure you have the appropriate `.env.local` file configured before running the containers. This file should contain:
|
| 192 |
+
- API keys
|
| 193 |
+
- Environment-specific configurations
|
| 194 |
+
- Other required environment variables
|
| 195 |
+
|
| 196 |
+
## Notes
|
| 197 |
+
|
| 198 |
+
- Port 5173 is exposed and mapped for both development and production environments
|
| 199 |
+
- Environment variables are loaded from `.env.local`
|
| 200 |
+
- Different profiles (development/production) can be used for different deployment scenarios
|
| 201 |
+
- The configuration supports both local development and production deployment
|