feat: update Docker setup and documentation for PostgreSQL integration
Build & Push Docker Image / Docker Build & Push (push) Successful in 1m32s
Lint / Lint (push) Successful in 11s
Tests / Test (push) Successful in 9s

This commit is contained in:
Gabriel20xx committed 2026-08-01 19:53:32 +02:00
1 parent f56eac28f7
commit 14a7348632
7 files changed
+46 -130

No files matched your search

+23 -32
View File
@@ -42,7 +42,7 @@ CollabTable allows multiple users to collaboratively create and manage lists wit
## Prerequisites
### Server
- **Docker** and **Docker Compose** (recommended)
- **Docker** and a PostgreSQL instance (bring your own - this app does not run Postgres for you)
- Or **Node.js 20+** for local development
### Android App
@@ -65,17 +65,20 @@ CollabTable allows multiple users to collaboratively create and manage lists wit
cp .env.example .env
```
3. **Start the server (this also starts a bundled PostgreSQL container):**
3. **Build and run the server, pointing at your own PostgreSQL instance:**
```bash
docker-compose up -d
docker build -t collabtable-server .
docker run -d --name collabtable-server --restart unless-stopped \
-p 3000:3000 \
-e DATABASE_URL=postgres://user:password@host:5432/collabtable \
collabtable-server
```
Server runs on `http://localhost:3000`. Open it in a browser to create the admin account,
then generate an API token from the dashboard's Settings page for your sync clients/devices
— see `CollabTableServer/README.md`'s "Authentication" section for details.
**Database:** PostgreSQL, provisioned automatically via the bundled `postgres` service in
`docker-compose.yml`.
**Database:** PostgreSQL, bring your own instance via `DATABASE_URL`.
### Android App
@@ -124,7 +127,6 @@ CollabTable/
├── webui/ # SvelteKit web dashboard (read-only database viewer)
├── data/ # SQLite database storage
├── Dockerfile
├── docker-compose.yml
└── README.md
```
@@ -340,34 +342,29 @@ The actual value for a specific field of an item:
```bash
# Find and kill process using port 3000
lsof -ti:3000 | xargs kill -9
# Or change port in docker-compose.yml or .env
# Or change the port mapping in your `docker run` command or .env
```
**Docker container won't start**
```bash
# View logs
docker-compose logs -f
docker logs -f collabtable-server
# Rebuild container
docker-compose down
docker-compose up -d --build
docker stop collabtable-server && docker rm collabtable-server
docker build -t collabtable-server . && docker run -d --name collabtable-server ...
```
**Database connection error (PostgreSQL)**
- Verify PostgreSQL is running
- Check connection details in `.env`
- Ensure database exists
**Data not persisting after container restart**
- Verify Docker volume exists: `docker volume ls`
- Check volume mount in `docker-compose.yml`
- For SQLite, data is in `sqlite_data` volume
- Verify your PostgreSQL instance is running and reachable from the container
- Check `DATABASE_URL` in `.env`
- Ensure the database exists
### Getting Help
- Check the [Android README](CollabTableAndroid/README.md) for app-specific details
- Check the [Server README](CollabTableServer/README.md) for server-specific details
- Review Docker logs: `docker-compose logs -f`
- Review Docker logs: `docker logs -f collabtable-server`
- Open an issue on GitHub with detailed error messages
## Synchronization
@@ -440,30 +437,24 @@ Response:
### Data Persistence
**PostgreSQL**
- Use standard PostgreSQL backup tools (`pg_dump`, `pg_restore`)
- The bundled `postgres` service's data is stored in a named Docker volume (`pg_data`), which
persists across container restarts
- Use standard PostgreSQL backup tools (`pg_dump`, `pg_restore`) against your own instance -
this app does not manage Postgres storage itself
### Docker Commands
**Start services:**
**Stop the container:**
```bash
docker-compose up -d
```
**Stop services:**
```bash
docker-compose down
docker stop collabtable-server
```
**View logs:**
```bash
docker-compose logs -f
docker logs -f collabtable-server
```
**Rebuild and restart:**
```bash
docker-compose up -d --build
docker build -t collabtable-server . && docker restart collabtable-server
```
**Check running containers:**
@@ -474,7 +465,7 @@ docker ps
### Production Deployment
**Environment Variables**
Configure these in `.env` or docker-compose.yml:
Configure these in `.env` or your `docker run` command:
```env
PORT=3000 # Server port
NODE_ENV=production # Environment