mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-01 18:19:08 +00:00
1.9 KiB
1.9 KiB
Docker Setup for SurfSense
This document explains how to run the SurfSense project using Docker Compose.
Prerequisites
- Docker and Docker Compose installed on your machine
- Git (to clone the repository)
Setup
-
Make sure you have all the necessary environment variables set up:
- Copy
surfsense_backend/.env.example
tosurfsense_backend/.env
and fill in the required values - Copy
surfsense_web/.env.example
tosurfsense_web/.env
and fill in the required values
- Copy
-
Build and start the containers:
docker-compose up --build
-
To run in detached mode (in the background):
docker-compose up -d
-
Access the applications:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
Useful Commands
-
Stop the containers:
docker-compose down
-
View logs:
# All services docker-compose logs -f # Specific service docker-compose logs -f backend docker-compose logs -f frontend docker-compose logs -f db
-
Restart a specific service:
docker-compose restart backend
-
Execute commands in a running container:
# Backend docker-compose exec backend python -m pytest # Frontend docker-compose exec frontend pnpm lint
Database
The PostgreSQL database with pgvector extensions is available at:
- Host: localhost
- Port: 5432
- Username: postgres
- Password: postgres
- Database: surfsense
You can connect to it using any PostgreSQL client.
Troubleshooting
- If you encounter permission errors, you may need to run the docker commands with
sudo
. - If ports are already in use, modify the port mappings in the
docker-compose.yml
file. - For backend dependency issues, you may need to modify the
Dockerfile
in the backend directory. - For frontend dependency issues, you may need to modify the
Dockerfile
in the frontend directory.