Skip to main content

Docker Quick Deployment

Use Docker Compose to quickly start a complete production environment.

1. Clone the Repository

git clone https://github.com/spark-ai-boy/SparkNoteAI.git
cd SparkNoteAI

2. Configure Environment Variables

Copy the environment template:

cp docker/.env.example docker/.env.production

Edit docker/.env.production and update the required fields:

VariableDescriptionGenerate With
POSTGRES_PASSWORDDatabase passwordCustom
REDIS_PASSWORDRedis passwordCustom
NEO4J_PASSWORDNeo4j passwordCustom
SECRET_KEYJWT secret keyopenssl rand -hex 32
ENCRYPTION_KEYEncryption keyopenssl rand -base64 32
CORS_ORIGINSAllowed frontend domainse.g., https://yourdomain.com
ADMIN_PASSWORDAdmin passwordCustom

3. Start Services

./docker/deploy.sh start

The deployment script automatically starts all services and initializes the database.

4. Access the Application

ServiceURL
Frontendhttp://your-server-ip
Backend APIhttp://your-server-ip:8000
Swagger UIhttp://your-server-ip:8000/docs

Default admin account: admin / the password you configured.

Operations Commands

./docker/deploy.sh status # Check service status
./docker/deploy.sh logs # View all logs
./docker/deploy.sh logs backend # View backend logs
./docker/deploy.sh backup # Backup database
./docker/deploy.sh stop # Stop services
./docker/deploy.sh restart # Restart services
./docker/deploy.sh clean # Clean all resources (including volumes)

Update Version

# Build and push new version image
npm run docker:deploy 1.2.0

# Production server: pull and restart
./docker/deploy.sh start