Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add environment variables and volumes #51

Merged
merged 4 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ Enable `log_error` in the `config.yml` file and check the console for the error
## Links
- [Pterodactyl Discord Server](https://discord.gg/pterodactyl)
- [Pelican Discord Server](https://discord.gg/pelican-panel)
- [Support Server](https://discord.znproject.my.id)
- [Support Server](https://discord.znproject.my.id)
10 changes: 8 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
version: '3.3'
services:
pterostats:
volumes:
- ./config.yml:/app/config.yml
container_name: pterostats
image: ghcr.io/hirzidevs/pterostats:latest
restart: always
volumes:
- ./config.yml:/app/config.yml
environment:
- PanelURL=<PANEL_URL>
- PanelKEY=<PANEL_KEY>
- DiscordBotToken=<DISCORD_BOT_TOKEN>
- DiscordChannel=<DISCORD_CHANNEL_ID>
20 changes: 12 additions & 8 deletions guide/docker.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Docker

This is a guide to run the bot using docker (alternative way to run the bot).
This is a guide to run the bot using docker (alternative way to run the bot)

### Installation

Expand All @@ -11,16 +11,20 @@ curl -fsSL https://get.docker.com | sh
### Docker Compose

- Copy the `docker-compose.yml` file to your server and run `docker compose pull`
- Copy the `config.yml` file at the same directory as the `docker-compose.yml` file and configure it (refer to the [Starting the App/Bot](https://github.com/HirziDevs/PteroStats#starting-the-appbot) section)
- Copy the `config.yml` file at the same directory as the `docker-compose.yml` file and configure it
- Fill the environment variables in the `docker-compose.yml` file and run the bot using `docker compose up -d`

```bash
docker compose up -d
docker compose logs -f pterostats
```
```bash
docker compose up -d
docker compose logs -f pterostats
```

### Docker Run

- Replace the `<PanelURL>`, `<PanelKEY>`, `<DISCORD_BOT_TOKEN>`, and `<DISCORD_CHANNEL_ID>` with your own values in the command below
- Copy the `config.yml` file at the same directory where you run the command and configure it

```bash
docker run -d --name pterostats -v $(pwd)/config.yml:/app/config.yml ghcr.io/hirzidevs/pterostats:latest
docker run -d --name pterostats -e PanelURL=<PanelURL> -e PanelKEY=<PanelKEY> -e DiscordBotToken=<DISCORD_BOT_TOKEN> -e DiscordChannel=<DISCORD_CHANNEL_ID> -v $(pwd)/config.yml:/app/config.yml ghcr.io/hirzidevs/pterostats:latest
docker logs -f pterostats
```
```
Loading