Skip to content

Commit

Permalink
Documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrisae9 committed Jun 12, 2024
1 parent f5f014b commit abfb6b5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
19 changes: 17 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,26 @@ Most of the setup can be inferred from the basic [README](README.md), but for lo
make pull
make push
```
- **Development Environment**: Open an interactive window where you can run `npm run start`.
- **Run the Application**: Start the application using:
```sh
make dev
```
- **Open a Shell in the Container**: Use this command to open a shell in the container:
```sh
make shell
```
- **Test Docker Environment**: Check if the Docker environment is set up correctly, including Docker group ID and user permissions:
```sh
make docker-test
```
- **Environment Variables Check**: Verify that the environment variables are correctly loaded into the container:
```sh
make env-check
```
- **Service Check**: Run a test Docker Compose file from the services directory to ensure services are configured correctly:
```sh
make service-check
```

## Style Guides

Expand All @@ -93,4 +109,3 @@ Most of the setup can be inferred from the basic [README](README.md), but for lo
## License

By contributing to this project, you agree that your contributions will be licensed under the [MIT License](LICENSE).

20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To quickly start the application, follow these steps:
4. **Manage Discord Commands**:
- **Pull Commands**: Populate `data/commands.json` with current commands from Discord by running:
```sh
docker run --env-file .env -v $(pwd)/data:/app/src/data --rm chrisae9/discord-webhook-service:latest npm run pull
docker run --env-file .env -v ./data:/app/src/data --rm chrisae9/discord-webhook-service:latest /bin/sh -c "npm run pull"
```
- **Update Commands**: Modify `data/commands.json` to include the following structure:
```json
Expand Down Expand Up @@ -94,7 +94,7 @@ To quickly start the application, follow these steps:
- **Push Commands**: Apply the updated commands by running:
```sh
docker run --env-file .env -v $(pwd)/data:/app/src/data --rm chrisae9/discord-webhook-service:latest npm run push
docker run --env-file .env -v ./data:/app/src/data --rm chrisae9/discord-webhook-service:latest /bin/sh -c "npm run push"
```
- Refer to the [`service.json`](/data/services.json) in the repository's [data](/data) folder to configure services:
Expand Down Expand Up @@ -130,6 +130,7 @@ To build and run the application using Docker Compose, use the following steps:
volumes:
- ./data:/app/src/data
- /var/run/docker.sock:/var/run/docker.sock
- ./services:/services
```
2. **Start the Application**:
Expand All @@ -138,13 +139,26 @@ To build and run the application using Docker Compose, use the following steps:
docker-compose up -d
```
- **About the `./services` Directory**:
- The `./services` directory will be mounted to `/services` in the container. This directory is used to specify paths or directories to services' Docker Compose files in the `service.json` configuration. You can add your own mounts to this directory.
- It is recommended to copy the structure from the repository's [`services/example/docker-compose.yaml`](./services/example/docker-compose.yaml) to first test your services. Here is an example of how your `services.json` might look:
```json
{
"name": "Example Service",
"value": "example-service",
"path": "/services/example",
"composeFile": "docker-compose.yaml",
"launchOptions": ""
}
```
### Using Docker Run
If you prefer not to use Docker Compose, you can run the application directly using `docker run` with the following command:
1. **Run the Docker Container**:
- Use the following command to start the application:
```sh
docker run --env-file .env -v $(pwd)/data:/app/src/data -v /var/run/docker.sock:/var/run/docker.sock -p 5000:5000 --name discord-webhook-service chrisae9/discord-webhook-service:latest
docker run --env-file .env -v ./services:/services -v ./data:/app/src/data -v /var/run/docker.sock:/var/run/docker.sock -p 5000:5000 --name discord-webhook-service chrisae9/discord-webhook-service:latest
```
## Configure Interaction Endpoint URL
Expand Down

0 comments on commit abfb6b5

Please sign in to comment.