update readme with better .env paths

This commit is contained in:
Barry Deen 2024-09-07 13:29:56 -04:00
parent 5ba7aae9cd
commit a385e86bad

View File

@ -5,6 +5,7 @@ WOT Relay is a Nostr relay that saves all the notes that people you follow, and
## Prerequisites ## Prerequisites
- **Go**: Ensure you have Go installed on your system. You can download it from [here](https://golang.org/dl/). - **Go**: Ensure you have Go installed on your system. You can download it from [here](https://golang.org/dl/).
- **Build Essentials**: If you're using Linux, you may need to install build essentials. You can do this by running `sudo apt install build-essential`.
## Setup Instructions ## Setup Instructions
@ -33,7 +34,9 @@ Open the `.env` file and set the necessary environment variables. Example variab
RELAY_NAME="YourRelayName" RELAY_NAME="YourRelayName"
RELAY_PUBKEY="YourPublicKey" RELAY_PUBKEY="YourPublicKey"
RELAY_DESCRIPTION="Your relay description" RELAY_DESCRIPTION="Your relay description"
DB_PATH="/path/to/your/database" DB_PATH="/home/ubuntu/wot-relay/db" # any path you would like the database to be saved.
INDEX_PATH="/home/ubuntu/wot-relay/templates/index.html" # path to the index.html file
STATIC_PATH="/home/ubuntu/wot-relay/templates/static" # path to the static folder
``` ```
### 4. Build the project ### 4. Build the project
@ -101,30 +104,31 @@ To start the project using Docker Compose, follow these steps:
4. You can also change the paths of the `db` folder and `templates` folder in the `docker-compose.yml` file. 4. You can also change the paths of the `db` folder and `templates` folder in the `docker-compose.yml` file.
```yaml ```yaml
volumes: volumes:
- "./db:/app/db" # only change the left side before the colon - "./db:/app/db" # only change the left side before the colon
- "./templates/index.html:/app/templates/index.html" # only change the left side before the colon - "./templates/index.html:/app/templates/index.html" # only change the left side before the colon
- "./templates/static:/app/templates/static" # only change the left side before the colon - "./templates/static:/app/templates/static" # only change the left side before the colon
``` ```
5. Run the following command: 5. Run the following command:
```sh ```sh
# in foreground # in foreground
docker compose up --build docker compose up --build
# in background # in background
docker compose up --build -d docker compose up --build -d
``` ```
6. For updating the relay, run the following command: 6. For updating the relay, run the following command:
```sh ```sh
git pull git pull
docker compose build --no-cache docker compose build --no-cache
# in foreground # in foreground
docker compose up docker compose up
# in background # in background
docker compose up -d docker compose up -d
``` ```
This will build the Docker image and start the `wot-relay` service as defined in the `docker-compose.yml` file. The application will be accessible on port 3334. This will build the Docker image and start the `wot-relay` service as defined in the `docker-compose.yml` file. The application will be accessible on port 3334.