Skip to content

Commit

Permalink
Merge pull request #1 from HolgerHatGarKeineNode/master
Browse files Browse the repository at this point in the history
Add Docker Compose Startup Instructions
  • Loading branch information
barrydeen authored Sep 6, 2024
2 parents e47aa19 + 86bad8e commit 060fd68
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use Golang image based on Debian Bookworm
FROM golang:bookworm

# Set the working directory within the container
WORKDIR /app

# Clone the repository
RUN git clone https://github.com/bitvora/wot-relay .

# Download Go module dependencies
RUN go mod download

# Write the .env file
RUN touch .env && \
echo "RELAY_NAME=${RELAY_NAME}" >> .env && \
echo "RELAY_PUBKEY=${RELAY_PUBKEY}" >> .env && \
echo "RELAY_DESCRIPTION=${RELAY_DESCRIPTION}" >> .env && \
echo "DB_PATH=${DB_PATH}" >> .env

# Build the Go application
RUN go build -o main .

# Expose the port that the application will run on
EXPOSE 3334

# Set the command to run the executable
CMD ["./main"]
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,32 @@ sudo systemctl start wot-relay
sudo systemctl enable wot-relay
```

### 6. Access the relay
### 6. Start the Project with Docker Compose (optional)

To start the project using Docker Compose, follow these steps:

1. Ensure Docker and Docker Compose are installed on your system.
2. Navigate to the project directory.
3. Edit the `docker-compose.yml` file to update the environment variables as needed:

```yaml
environment:
RELAY_NAME: "utxo WoT relay"
RELAY_PUBKEY: "YOURPUBKEY"
RELAY_DESCRIPTION: "Only notes in utxo WoT"
DB_PATH: "./db"
```
4. Run the following command:
```sh
docker-compose up --build
```

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.


### 7. Access the relay

Once everything is set up, the relay will be running on `localhost:3334`.

Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
wot-relay:
build:
context: .
dockerfile: Dockerfile
environment:
RELAY_NAME: "utxo WoT relay"
RELAY_PUBKEY: "e2ccf7cf20403f3f2a4a55b328f0de3be38558a7d5f33632fdaaefc726c1c8eb"
RELAY_DESCRIPTION: "Only notes in utxo WoT"
DB_PATH: "./db"
volumes:
- "./db:/app/db"
ports:
- "3334:3334"

0 comments on commit 060fd68

Please sign in to comment.