postgres
This commit is contained in:
parent
b0f3e6c576
commit
e44d419b58
15 changed files with 233 additions and 82 deletions
29
README.md
29
README.md
|
@ -1,20 +1,37 @@
|
|||
# next-url-shortener
|
||||
A simple URL shortener using [Next.js](https://nextjs.org/) 14 server actions, [Postgres](https://www.postgresql.org/) or [SurrealDB](https://surrealdb.com/), [Shadcn/ui](http://ui.shadcn.com/) and [Tailwind](https://tailwindcss.com/).
|
||||
|
||||
# Install
|
||||
Copy [docker-compose.yml](./docker-compose.yml)
|
||||
### Copy one
|
||||
- [docker-compose-postgres.yml](./docker-compose-postgres.yml)
|
||||
- [docker-compose-surrealdb.yml](./docker-compose-surrealdb.yml)
|
||||
|
||||
Create data folder next to docker-compose.yml and .env, and set the data type in .env
|
||||
```
|
||||
├── data
|
||||
│ └── surrealdb
|
||||
├── docker-compose.yml
|
||||
├── docker-compose-postgres.yml
|
||||
└── .env
|
||||
```
|
||||
|
||||
`docker compose up --pull always -d`
|
||||
### Then run:
|
||||
- `docker compose -f docker-compose-postgres.yml up --pull always -d`
|
||||
- `docker compose -f docker-compose-surrealdb.yml up --pull always -d`
|
||||
|
||||
## Example .env
|
||||
```
|
||||
# If not using docker, use 0.0.0.0:8000
|
||||
DB_URL_PORT=surrealdb:8000
|
||||
# postgres or surrealdb
|
||||
DB_TYPE=postgres
|
||||
|
||||
# For surrealdb: If using docker surrealdb:8000, if not use 0.0.0.0:8000
|
||||
# For postgres: If using docker postgres:5432, if not use 0.0.0.0:5432
|
||||
DB_URL_PORT=postgres:5432
|
||||
|
||||
# postgres
|
||||
POSTGRES_USER=root
|
||||
POSTGRES_PASSWORD=root
|
||||
POSTGRES_DB=url
|
||||
|
||||
# surrealdb
|
||||
DB_USER=root
|
||||
DB_PASSWORD=root
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue