-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some fixes for docker and make session_maker.sh executable (#6)
* Add docker-compose * Dockerfile: use latest images for bot * update sample config for full postgres uri example
- Loading branch information
Showing
5 changed files
with
38 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
** | ||
!modules | ||
!sql | ||
!utils | ||
!*.go | ||
!go.* | ||
!config* | ||
!vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
# Build Stage: Build bot using the alpine image, also install doppler in it | ||
FROM golang:1.18-alpine AS builder | ||
RUN addgroup -S scratchuser \ | ||
&& adduser -S -u 10000 -g scratchuser scratchuser | ||
RUN apk add -U --no-cache ca-certificates | ||
FROM golang:latest AS builder | ||
RUN apt-get update && apt-get upgrade -y && apt-get install build-essential -y | ||
WORKDIR /app | ||
COPY . . | ||
RUN CGO_ENABLED=0 GOOS=`go env GOHOSTOS` GOARCH=`go env GOHOSTARCH` go build -o out/GigaUserbot -ldflags="-w -s" . | ||
RUN GOOS=`go env GOHOSTOS` GOARCH=`go env GOHOSTARCH` go build -o out/GigaUserbot -ldflags="-w -s" . | ||
|
||
# Run Stage: Run bot using the bot and doppler binary copied from build stage | ||
FROM scratch | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=builder /app/out/GigaUserbot / | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
USER scratchuser | ||
CMD ["/GigaUserbot"] | ||
FROM ubuntu:latest | ||
COPY --from=builder /app/out/GigaUserbot /app/GigaUserbot | ||
COPY config.json config.json | ||
CMD ["/app/GigaUserbot"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: '3.9' | ||
services: | ||
db: | ||
image: postgres:latest | ||
restart: always | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
giga-ub: | ||
image: giga-ub | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
links: | ||
- db | ||
depends_on: | ||
- db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"app_id":12345, | ||
"api_hash":"hash", | ||
"db_uri": "postgres://", | ||
"session_string":"string" | ||
} | ||
"app_id": 12345, | ||
"api_hash": "hash", | ||
"db_uri": "postgres://postgres:postgres@db:5432/postgres", | ||
"session_string": "string" | ||
} |
Empty file.