Added base Dockerfile, main.go and redis queue

pull/5/head
Paulo Truta 2020-11-08 23:43:18 +01:00
parent 9a03165f35
commit 58e7d2712b
4 changed files with 43 additions and 0 deletions

11
Dockerfile 100644
View File

@ -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

View File

@ -0,0 +1,8 @@
version: "3"
services:
go-docker-image:
build: ./
volumes:
- ./:/app
edgebox-queue:
image: redis-alpine

4
go.mod 100644
View File

@ -0,0 +1,4 @@
module github.com/edgebox-iot/sysctl
go 1.15

20
main.go 100644
View File

@ -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)
}