configurable url
This commit is contained in:
58
README.md
58
README.md
@@ -4,6 +4,24 @@ A self-hosted web application for storing, organizing, and reading short stories
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Option 1: Using Environment-Specific Deployment (Recommended)
|
||||
|
||||
1. Deploy for your environment:
|
||||
```bash
|
||||
# For development
|
||||
./deploy.sh development
|
||||
|
||||
# For staging
|
||||
./deploy.sh staging
|
||||
|
||||
# For production (edit .env.production first with your values)
|
||||
./deploy.sh production
|
||||
```
|
||||
|
||||
2. Edit the environment file (`.env.development`, `.env.staging`, or `.env.production`) with your specific configuration
|
||||
|
||||
### Option 2: Manual Configuration
|
||||
|
||||
1. Copy environment variables:
|
||||
```bash
|
||||
cp .env.example .env
|
||||
@@ -16,7 +34,7 @@ cp .env.example .env
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
4. Access the application at http://localhost
|
||||
4. Access the application at the URL specified in your environment configuration (default: http://localhost:6925)
|
||||
|
||||
## Architecture
|
||||
|
||||
@@ -26,6 +44,44 @@ docker-compose up -d
|
||||
- **Search**: Typesense (Port 8108)
|
||||
- **Proxy**: Nginx (Port 80)
|
||||
|
||||
## Environment Configuration
|
||||
|
||||
StoryCove supports different deployment environments with specific configuration files:
|
||||
|
||||
### Environment Files
|
||||
|
||||
- `.env.development` - Local development with Docker
|
||||
- `.env.staging` - Staging/testing environment
|
||||
- `.env.production` - Production deployment
|
||||
- `.env.example` - Template with all available options
|
||||
|
||||
### Key Environment Variables
|
||||
|
||||
- `STORYCOVE_PUBLIC_URL` - The public URL where your app is accessible
|
||||
- `STORYCOVE_CORS_ALLOWED_ORIGINS` - Comma-separated list of allowed CORS origins
|
||||
- `DB_PASSWORD` - PostgreSQL database password
|
||||
- `JWT_SECRET` - Secret key for JWT token signing (minimum 32 characters)
|
||||
- `APP_PASSWORD` - Application login password
|
||||
- `TYPESENSE_API_KEY` - API key for Typesense search service
|
||||
- `NEXT_PUBLIC_API_URL` - Frontend API URL (for development only)
|
||||
|
||||
### Deployment Examples
|
||||
|
||||
For a production deployment at `https://stories.example.com`:
|
||||
```bash
|
||||
# Edit .env.production
|
||||
STORYCOVE_PUBLIC_URL=https://stories.example.com
|
||||
STORYCOVE_CORS_ALLOWED_ORIGINS=https://stories.example.com
|
||||
|
||||
# Deploy
|
||||
./deploy.sh production
|
||||
```
|
||||
|
||||
For local development:
|
||||
```bash
|
||||
./deploy.sh development
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### Frontend Development
|
||||
|
||||
Reference in New Issue
Block a user