Skip to content

Commit 0d60c62

Browse files
committed
Fix Docker build context for entrypoint
1 parent 06c9f01 commit 0d60c62

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.cache/
2-
emby-transcoder
2+
/emby-transcoder
33
config.local.json
44
dist/
55
tmp/

cmd/emby-transcoder/main.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package main
2+
3+
import (
4+
"flag"
5+
"log"
6+
"net/http"
7+
8+
"emby-transcoder/internal/config"
9+
"emby-transcoder/internal/proxy"
10+
)
11+
12+
func main() {
13+
configPath := flag.String("config", "", "path to config JSON file")
14+
flag.Parse()
15+
16+
cfg, err := config.Load(*configPath)
17+
if err != nil {
18+
log.Fatalf("load config: %v", err)
19+
}
20+
21+
handler, err := proxy.New(cfg)
22+
if err != nil {
23+
log.Fatalf("create proxy: %v", err)
24+
}
25+
26+
log.Printf("EmbyTranscoder listening on %s, upstream %s", cfg.Server.Listen, cfg.Upstream.URL)
27+
if err := http.ListenAndServe(cfg.Server.Listen, handler); err != nil {
28+
log.Fatal(err)
29+
}
30+
}

0 commit comments

Comments
 (0)