Add Dockerfile and info

Signed-off-by: Sid Sun <sid@sidsun.com>
This commit is contained in:
Sid Sun 2024-05-14 00:03:02 +05:30
parent e04f58fccf
commit ab020a1423
4 changed files with 38 additions and 0 deletions

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM golang as builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN make build
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /app
COPY --from=builder /app/bin/ /app/
CMD ["/app/openwebui-telegram"]

View File

@ -11,3 +11,6 @@ tidy:
serve: fmt vet serve: fmt vet
env $(cat dev.env | xargs) go run cmd/*.go env $(cat dev.env | xargs) go run cmd/*.go
build: fmt vet
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o bin/openwebui-telegram ./cmd

View File

@ -49,6 +49,16 @@ The bot supports two commands:
## How to run ## How to run
### Docker Compose
Copy the docker-compose.yml in this repo, create your env file in `dev.env` and run:
```bash
docker compose up
```
### Shell
In the fish shell, you can just do: In the fish shell, you can just do:
```fish ```fish
@ -61,6 +71,7 @@ bash:
env $(cat dev.env | xargs -L 1) make serve env $(cat dev.env | xargs -L 1) make serve
``` ```
## Contributing ## Contributing
Contributions are welcome. Please submit a pull request or create an issue if you have any improvements or suggestions. Contributions are welcome. Please submit a pull request or create an issue if you have any improvements or suggestions.

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: "3"
services:
openwebui-telegram:
# build:
# context: .
# dockerfile: Dockerfile
image: realsidsun/openwebui-telegram:latest
env_file:
- dev.env
network_mode: host
restart: unless-stopped