Skip to content

Commit

Permalink
MMerge branch 'master' of github.com:MoonSHRD/TelegramNFTWizard
Browse files Browse the repository at this point in the history
  • Loading branch information
JackBekket committed Dec 17, 2022
2 parents 180f807 + 3c9a032 commit d2bd6dc
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
*.secret
*.env

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and push

on:
push:
branches:
- 'master'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM golang:1.17-alpine AS build_base

RUN apk add --no-cache alpine-sdk

# Set the Current Working Directory inside the container
WORKDIR /app

# We want to populate the module cache based on the go.{mod,sum} files.
COPY go.mod .
COPY go.sum .

RUN go mod download

COPY . .

RUN go build -o /out/bot .

FROM alpine:latest

WORKDIR /app

RUN apk add ca-certificates
COPY --from=build_base /out/bot ./bot

CMD ["/app/bot"]
11 changes: 11 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3.9"

services:
bot:
container_name: nft-wizard-bot
image: nft-wizard-bot
build:
dockerfile: Dockerfile
restart: always
volumes:
- ".env:/app/.env"
16 changes: 16 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3.9"

services:
bot:
container_name: nft-wizard-bot
image: ghcr.io/moonshrd/telegramnftwizard
restart: always
volumes:
- ".env:/app/.env"

watchtower:
image: containrrr/watchtower
command: --interval 300 --include-stopped --include-restarting --cleanup
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ~/.docker/config.json:/config.json

0 comments on commit d2bd6dc

Please sign in to comment.