Added base Dockerfile, main.go and redis queue
parent
9a03165f35
commit
58e7d2712b
|
@ -0,0 +1,11 @@
|
|||
FROM golang:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./ /app
|
||||
|
||||
RUN go mod download
|
||||
|
||||
RUN go get github.com/githubnemo/CompileDaemon
|
||||
|
||||
ENTRYPOINT CompileDaemon --build="go build main.go" --command=./runsysctl
|
|
@ -0,0 +1,8 @@
|
|||
version: "3"
|
||||
services:
|
||||
go-docker-image:
|
||||
build: ./
|
||||
volumes:
|
||||
- ./:/app
|
||||
edgebox-queue:
|
||||
image: redis-alpine
|
|
@ -0,0 +1,20 @@
|
|||
# main.go
|
||||
package main
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/go-redis/redis/v8"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
fmt.Println("Hello World")
|
||||
|
||||
client := redis.NewClient(&redis.Options{
|
||||
Addr: "redis:6379",
|
||||
Password: "", // no password set
|
||||
DB: 0, // use default DB
|
||||
})
|
||||
pong, err := client.Ping().Result()
|
||||
fmt.Println(pong, err)
|
||||
|
||||
}
|
Loading…
Reference in New Issue