Add Dockerfile and info
Signed-off-by: Sid Sun <sid@sidsun.com>
This commit is contained in:
parent
e04f58fccf
commit
ab020a1423
|
@ -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"]
|
3
Makefile
3
Makefile
|
@ -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
|
||||||
|
|
11
README.md
11
README.md
|
@ -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.
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue