README: lead with one-command setup.sh as primary install method, manual docker steps as fallback
This commit is contained in:
143
deploy/README.md
143
deploy/README.md
@@ -1,28 +1,58 @@
|
||||
# Project Tracker - Docker Compose Deployment
|
||||
# Project Tracker
|
||||
|
||||
## Quick Start
|
||||
A self-hosted project tracking web app. Dark-themed, minimal, fast.
|
||||
|
||||
**Live:** https://projects.ledrew.me
|
||||
|
||||
---
|
||||
|
||||
## Quick Start (One Command)
|
||||
|
||||
On a **fresh Debian/Ubuntu** server with Docker:
|
||||
|
||||
```bash
|
||||
curl -sL https://gitea.ledrew.me/ledadmin/project-tracker/raw/branch/master/deploy/setup.sh -o setup.sh && bash setup.sh
|
||||
```
|
||||
|
||||
That's it. The script handles everything: system update → Docker → Docker Compose → clone → build → start.
|
||||
|
||||
**Requires:** Debian/Ubuntu, root access, port 80 available.
|
||||
|
||||
**What it does:**
|
||||
1. Updates system packages
|
||||
2. Installs Docker (if not present)
|
||||
3. Clones this repo
|
||||
4. Builds and starts the app via Docker Compose
|
||||
5. Shows you the URL when done
|
||||
|
||||
To interactively confirm before running, download first:
|
||||
```bash
|
||||
curl -sL https://gitea.ledrew.me/ledadmin/project-tracker/raw/branch/master/deploy/setup.sh -o setup.sh
|
||||
bash setup.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Manual Docker Install
|
||||
|
||||
If you prefer to install manually or already have Docker:
|
||||
|
||||
```bash
|
||||
# Install Docker
|
||||
apt-get update
|
||||
apt-get install -y docker.io docker-compose
|
||||
|
||||
# Clone and start
|
||||
git clone https://gitea.ledrew.me/ledadmin/project-tracker.git
|
||||
cd project-tracker/deploy
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
App available at `http://<your-server-ip>`
|
||||
|
||||
---
|
||||
|
||||
## First Run Notes
|
||||
|
||||
- The SQLite database initializes automatically on first start (empty)
|
||||
- The database file is persisted in a Docker named volume (`project-tracker-data`)
|
||||
- Projects added through the web UI are stored in the database, not in the code
|
||||
|
||||
---
|
||||
|
||||
## Seed Sample Projects
|
||||
|
||||
To populate with sample projects after first deploy:
|
||||
After first deploy, populate with sample projects:
|
||||
|
||||
```bash
|
||||
docker exec -it project-tracker-api node -e "
|
||||
@@ -42,16 +72,15 @@ console.log('Seeded', items.length, 'projects');
|
||||
|
||||
---
|
||||
|
||||
## Commands
|
||||
## Useful Commands
|
||||
|
||||
```bash
|
||||
docker compose up -d --build # Build and start (always use --build to pick up code changes)
|
||||
docker compose logs -f # View logs
|
||||
docker compose logs -f backend # View backend logs only
|
||||
docker compose logs -f backend # Backend logs only
|
||||
docker compose restart # Restart
|
||||
docker compose down # Stop
|
||||
docker compose down -v # Stop and DELETE database volume (CAREFUL!)
|
||||
docker exec -it project-tracker-api sh # Shell into backend container
|
||||
docker compose down -v # Stop and DELETE database (CAREFUL!)
|
||||
docker exec -it project-tracker-api sh # Shell into backend
|
||||
```
|
||||
|
||||
---
|
||||
@@ -75,17 +104,14 @@ docker exec -it project-tracker-api sh # Shell into backend container
|
||||
|
||||
---
|
||||
|
||||
## Volumes
|
||||
|
||||
| Volume | Mount | Description |
|
||||
|---|---|---|
|
||||
| `project-tracker-data` | `/app/data` | SQLite database file |
|
||||
|
||||
---
|
||||
|
||||
## Updating
|
||||
|
||||
```bash
|
||||
# With setup.sh (pulls latest, rebuilds):
|
||||
curl -sL https://gitea.ledrew.me/ledadmin/project-tracker/raw/branch/master/deploy/setup.sh -o setup.sh && bash setup.sh
|
||||
|
||||
# Manual update:
|
||||
cd project-tracker
|
||||
git pull
|
||||
docker compose down
|
||||
docker compose up -d --build
|
||||
@@ -96,3 +122,68 @@ docker compose up -d --build
|
||||
## SSL / HTTPS
|
||||
|
||||
For HTTPS, put nginx behind a reverse proxy (e.g., NginxProxyManager, Traefik, Caddy) on port 80/443. The nginx container should NOT be exposed directly to the internet.
|
||||
|
||||
---
|
||||
|
||||
## Stack
|
||||
|
||||
- **Backend:** Node.js + Express + better-sqlite3
|
||||
- **Frontend:** Vanilla JS + CSS (no framework, no build step)
|
||||
- **Web Server:** nginx (reverse proxy + static files)
|
||||
- **Database:** SQLite (single file, no server process)
|
||||
- **Deploy:** Docker Compose (2 containers: backend + nginx)
|
||||
|
||||
---
|
||||
|
||||
## API
|
||||
|
||||
| Method | Endpoint | Description |
|
||||
|---|---|---|
|
||||
| GET | `/api/projects` | List all projects |
|
||||
| GET | `/api/projects/:id` | Get single project |
|
||||
| POST | `/api/projects` | Create project |
|
||||
| PUT | `/api/projects/:id` | Update project |
|
||||
| DELETE | `/api/projects/:id` | Delete project |
|
||||
|
||||
### Body (POST/PUT)
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Project Name",
|
||||
"priority": "High|Med-High|Medium|Low",
|
||||
"url": "https://...",
|
||||
"notes": "Description...",
|
||||
"status": "Active|Backlog|On Hold|Completed",
|
||||
"owner": "Ada",
|
||||
"tags": "tag1,tag2"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
project-tracker/
|
||||
├── deploy/
|
||||
│ ├── docker-compose.yml # Services definition
|
||||
│ ├── Dockerfile # Backend (Node.js)
|
||||
│ ├── Dockerfile.nginx # nginx + frontend
|
||||
│ ├── nginx.conf # Reverse proxy config
|
||||
│ ├── setup.sh # One-shot deploy script
|
||||
│ ├── www/ # Frontend (baked into nginx)
|
||||
│ │ ├── index.html
|
||||
│ │ └── favicon.png
|
||||
│ └── README.md
|
||||
└── backend/
|
||||
├── server.js # Express API
|
||||
└── package.json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
- No authentication on the API — intended for internal use behind a reverse proxy
|
||||
- CORS is open for development; restrict in production if needed
|
||||
- Database persists in Docker named volume — survives `docker compose down/up`
|
||||
|
||||
Reference in New Issue
Block a user