Skip to content

Commit

Permalink
add docker example
Browse files Browse the repository at this point in the history
  • Loading branch information
geovex committed Aug 2, 2023
1 parent 7d5c276 commit 204850a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Docker Image CI

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build --tag tgp --target deploy .
- run:
docker run tgp test -f /app/tgp
- run:
docker run tgp test -f /app/config.toml
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM docker.io/golang:1.20-alpine AS build
WORKDIR /app
ADD . ./
RUN go mod download && go build ./cmd/tgp

FROM docker.io/golang:1.20-alpine AS deploy
RUN apk add --no-cache gcompat
WORKDIR /app
COPY --from=build /app/tgp ./
ADD config.toml ./
# EXPOSE 6666
CMD ./tgp config.toml
2 changes: 2 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
listen_url = "0.0.0.0:6666"
secret = "dd000102030405060708090a0b0c0d0e0f"

0 comments on commit 204850a

Please sign in to comment.