Improve onboarding docs

pull/1558/head
Stanislav Khromov 2022-10-09 21:46:54 +02:00
parent 0cb14f3f6c
commit 12db1b0961
4 changed files with 78 additions and 0 deletions

1
.gitignore vendored
View File

@ -12,6 +12,7 @@
/.next/
/out/
/prisma/
prisma
# production
/build

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
18

View File

@ -101,6 +101,57 @@ docker compose pull
docker compose up --force-recreate
```
## Setting up a local development environment for Umami
If you want to run Umami locally for development purposes, you can follow these instructions.
1. Set correct Node version and install dependencies:
```bash
nvm use
npm i
```
2. Run the development Dockerfile which will start PostgreSQL and Adminer (for database administration)
```bash
docker-compose -f docker-compose.development.yml up
```
3. Create an `.env` file with the following content:
```
DATABASE_URL=postgresql://umami:umami@localhost:54320/umami
```
4. Run:
```bash
ln -s ./db/postgresql prisma
npm run build-db-client
```
This will synlink the schema from `db/postgresql` to `prisma/` and generate your Prisma client.
5. Run migrations
```bash
yarn update-db
```
6. Start the server
```bash
yarn dev
```
You can now visit: http://localhost:3000/
7. Debug database
An Adminer instance is provided, you can reach it at:
http://localhost:8080/
## License
MIT

View File

@ -0,0 +1,25 @@
---
version: '3'
services:
db:
image: postgres:12-alpine
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami
POSTGRES_PASSWORD: umami
ports:
- "54320:5432"
adminer:
image: michalhosna/adminer
ports:
- 8080:8080
environment:
ADMINER_DB: umami
ADMINER_DRIVER: pgsql
ADMINER_PASSWORD: umami
ADMINER_SERVER: db
ADMINER_USERNAME: umami
ADMINER_AUTOLOGIN: 1
ADMINER_NAME: Adminer
volumes:
umami-db-data: