diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 64a3449..4b9de83 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -22,7 +22,7 @@ jobs: go-version: '1.18.x' - uses: actions/checkout@v3 - name: golangci-lint - uses: golangci/golangci-lint-action@v3.3.0 + uses: golangci/golangci-lint-action@v3.3.1 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version version: v1.45.0 diff --git a/Dockerfile b/Dockerfile index 90c5738..50381a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,22 @@ -FROM golang:latest +FROM docker.io/library/golang:1.19.3-buster +RUN apt-get update + +# install dependencies required to run giu application +RUN apt-get install -y libgtk-3-dev libasound2-dev libxxf86vm-dev + +# set workidr WORKDIR /app +# move all the stuff into working directory ADD . /app +# go-get pakcages (I recommend using go's vendoring-mode since it makes modules downloading super-fast +# as they are in fact already downloaded and stored by previous command) RUN go get -d ./... -CMD go run github.com/gucio321/tic-tac-go/cmd/terminal-game +# pre-build binaries to make running them faster +RUN go build github.com/gucio321/tic-tac-go/cmd/giu-game + +# define command to run +CMD go run github.com/gucio321/tic-tac-go/cmd/giu-game diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..c12b41f --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,12 @@ +version: "3" + +services: + app: + build: . + environment: + - DISPLAY=${DISPLAY} + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix + security_opt: + - label:type:container_runtime_t + network_mode: bridge