documentation and env changes
This commit is contained in:
63
docs/setup.md
Normal file
63
docs/setup.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# Setup
|
||||
|
||||
## Prerequisites
|
||||
- Docker + Docker Compose
|
||||
- Spotify Developer account (Client ID/Secret)
|
||||
- A unique `APP_SECRET` value in your environment (for prod builds)
|
||||
|
||||
## 1) Start the stack
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
App: `http://localhost:8085`
|
||||
Health: `http://localhost:8085/healthz`
|
||||
|
||||
## 2) Create an admin
|
||||
```bash
|
||||
docker compose exec tonehaus php bin/console app:promote-admin you@example.com
|
||||
```
|
||||
|
||||
## 3) Configure Spotify
|
||||
- Preferred: open `/admin/settings` and enter your Client ID/Secret (stored in DB)
|
||||
- Env fallback (in `.env` or your shell):
|
||||
```bash
|
||||
SPOTIFY_CLIENT_ID=your_client_id
|
||||
SPOTIFY_CLIENT_SECRET=your_client_secret
|
||||
```
|
||||
|
||||
## 4) (Optional) Seed demo data
|
||||
```bash
|
||||
docker compose exec tonehaus php bin/console app:seed-demo-users --count=50
|
||||
docker compose exec tonehaus php bin/console app:seed-demo-albums --count=40 --attach-users
|
||||
docker compose exec tonehaus php bin/console app:seed-demo-reviews --cover-percent=70 --max-per-album=8
|
||||
```
|
||||
|
||||
## Database drivers
|
||||
- SQLite (default): set `DATABASE_DRIVER=sqlite` (default) — data stored at `var/data/database.sqlite`
|
||||
- Postgres: set `DATABASE_DRIVER=postgres` and provide `DATABASE_URL`
|
||||
- If you enable the commented `db` service in `docker-compose.yml`, a typical URL is:
|
||||
```
|
||||
postgresql://symfony:symfony@db:5432/symfony?serverVersion=16&charset=utf8
|
||||
```
|
||||
|
||||
## Environment variables
|
||||
- `APP_ENV=dev|prod`
|
||||
- `APP_SECRET=<random_string>`
|
||||
- `SPOTIFY_CLIENT_ID`, `SPOTIFY_CLIENT_SECRET`
|
||||
- `APP_ALLOW_REGISTRATION=1|0` (env can override DB setting)
|
||||
- `DATABASE_DRIVER=sqlite|postgres`
|
||||
- `DATABASE_SQLITE_PATH` (optional)
|
||||
- `RUN_MIGRATIONS_ON_START=1|0` (default 1)
|
||||
|
||||
## Useful commands
|
||||
```bash
|
||||
# Symfony cache
|
||||
docker compose exec tonehaus php bin/console cache:clear
|
||||
|
||||
# Inspect routes
|
||||
docker compose exec tonehaus php bin/console debug:router
|
||||
|
||||
# Promote moderator
|
||||
docker compose exec tonehaus php bin/console app:promote-moderator mod@example.com
|
||||
```
|
||||
Reference in New Issue
Block a user