Add hub directory with Dockerfile to build and stuff

master
Elis Hirwing 2020-11-20 22:33:06 +01:00
parent 1e0086d29c
commit f790bda8f4
Signed by: etu
GPG Key ID: D57EFA625C9A925F
4 changed files with 44 additions and 0 deletions

View File

@ -13,3 +13,11 @@ services:
- PORT=8080
- HUB_URL=http://hub:8080
- TOPIC=a-topic
hub:
build:
context: ./hub
ports:
- "8080:8080"
volumes:
- ./hub:/go/src/hub

26
hub/Dockerfile Normal file
View File

@ -0,0 +1,26 @@
FROM golang:1.15
RUN go get -u -v github.com/codeskyblue/fswatch
RUN mkdir -p /go/src/hub
WORKDIR /go/src/hub
RUN echo "desc: Auto generated by fswatch [hubd] \n\
triggers: \n\
- name: '' \n\
pattens: \n\
- '**/*.go' \n\
env: \n\
DEBUG: '1' \n\
cmd: go run /go/src/hub/*.go \n\
shell: true \n\
delay: 100ms \n\
stop_timeout: 500ms \n\
signal: KILL \n\
kill_signal: '' \n\
watch_paths: \n\
- . \n\
watch_depth: 10 \n\
" >> /fsw.yml
CMD fswatch -config /fsw.yml

3
hub/go.mod Normal file
View File

@ -0,0 +1,3 @@
module git.elis.nu/etu/websubhub/hub
go 1.15

7
hub/main.go Normal file
View File

@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println("Hello")
}