mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-09-30 08:35:45 +02:00
Added base Dockerfile, main.go and redis queue
This commit is contained in:
+11
@@ -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)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user