Skip to content

Commit

Permalink
Adds container image
Browse files Browse the repository at this point in the history
  • Loading branch information
cuducos committed Aug 1, 2024
1 parent 2a00a1b commit d7ef56d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM rust:1-slim-bookworm AS builder
ADD Cargo.* .
ADD src/* src/
RUN apt update && \
apt install -y libssl-dev pkg-config && \
cargo build --release && \
cp target/release/airnope /usr/local/bin && \
cargo clean && \
apt purge -y libssl-dev pkg-config && \
apt autoremove -y && \
rm -rf /var/lib/apt/lists/*

FROM debian:bookworm-slim
COPY --from=builder /usr/local/bin/airnope /usr/local/bin/airnope
RUN apt update && \
apt install -y ca-certificates openssl && \
apt autoremove -y && \
rm -rf /var/lib/apt/lists/*
CMD ["airnope"]

23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,28 @@ A simple, silent bot that keeps [Telegram](https://telegram.org/) groups free fr

## Developing and contributing

Requires an environment variable called `TELOXIDE_TOKEN` with the Telegram API token.
### Requirements

AirNope requires an environment variable called `TELOXIDE_TOKEN` with the [Telegram API token](https://core.telegram.org/bots/#how-do-i-create-a-bot).

### Running it

To avoid attackers trying to bring the server down, this bot does not use a webhook strategy. To start the daemon, run:

```console
$ cargo run
```

Or, if you don't have [`rustup`](https://www.rust-lang.org/tools/install), you can use the container image:

```console
$ docker build -t airnope .
$ docker run -e TELOXIDE_TOKEN=<YOUR TELEGRAM API TOKEN> -d airnope
```

### Before opening a PR

Make sure these checks pass:

```console
$ cargo test
Expand Down

0 comments on commit d7ef56d

Please sign in to comment.