Skip to content

Commit

Permalink
Fix config not working in container
Browse files Browse the repository at this point in the history
  • Loading branch information
robrotheram committed Feb 28, 2024
1 parent 26edf11 commit 63f8ede
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 31 deletions.
6 changes: 3 additions & 3 deletions app.sample.env
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
SERVER_ADDRESS=0.0.0.0:8081
DISCORD_TOKEN=CHANGEME
DISCORD_CLIENT_ID=CHANGEME
DISCORD_CLIENT_SECRET=CHANGEME
SESSION_SECRET=CHANGEME
BASE_URL=http://localhost:8080
DEVELOPMENT=false
DISCORD_ENABLE_NOTIFICATIONS=true
LISTEN_PORT=8080
LOG_LEVEL=info
DATABASE_PATH=/data
DATABASE_PATH=/data
RESET=false
BETTER_STACK_TOKEN=OPTIONAL
29 changes: 5 additions & 24 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,26 @@
services:

watch2gether:
image: ghcr.io/robrotheram/go-watch2gether:latest
restart: always
networks:
- caddy
build:
context: .
environment:
DISCORD_TOKEN: CHANGE_ME
DISCORD_CLIENT_ID: CHANGE_ME
DISCORD_CLIENT_SECRET: CHANGE_ME
SESSION_SECRET: CHANGE_ME
BASE_URL: https://watch2gether.exceptionerror.io
DEVELOPMENT: true
DISCORD_ENABLE_NOTIFICATIONS: false
DEVELOPMENT: 'true'
DISCORD_ENABLE_NOTIFICATIONS: 'false'
LISTEN_PORT: 8080
LOG_LEVEL: info
RESET: 'true'
DATABASE_PATH: "/data"
volumes:
- w2g_data:/data
labels:
caddy: watch2gether.exceptionerror.io
caddy.reverse_proxy: "{{upstreams 8080}}"

caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
ports:
- 80:80
- 443:443
environment:
- CADDY_INGRESS_NETWORKS=caddy
networks:
- caddy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- caddy_data:/data
restart: unless-stopped

networks:
caddy:
external: true

volumes:
caddy_data: {}
w2g_data: {}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ require (
github.com/robrotheram/dca v0.0.0-20240103231016-764e174aecab
github.com/segmentio/ksuid v1.0.4
github.com/sirupsen/logrus v1.9.3
github.com/spf13/viper v1.18.2
golang.org/x/net v0.21.0
golang.org/x/oauth2 v0.17.0
gopkg.in/vansante/go-ffprobe.v2 v2.1.1
github.com/spf13/viper v1.17.0
)

require (
Expand Down
13 changes: 10 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"os"
"path/filepath"
"strings"
"w2g/pkg/api"
"w2g/pkg/controllers"
"w2g/pkg/discord"
Expand Down Expand Up @@ -34,12 +35,18 @@ func main() {
log.Fatalf("Database Error: %v", err)
}

log.Infof("Version: %s", utils.Version)
log.Infof("Version: %s", strings.TrimSuffix(utils.Version, "\r\n"))

hub := controllers.NewHub(db)

bot, _ := discord.NewDiscordBot(utils.Configuration, hub)
bot.Start()
bot, err := discord.NewDiscordBot(utils.Configuration, hub)
if err != nil {
log.Warnf("discord bot error: %v", err)
}
err = bot.Start()
if err != nil {
log.Warnf("discord bot error: %v", err)
}
defer bot.Close()

app := api.NewApp(utils.Configuration, hub)
Expand Down

0 comments on commit 63f8ede

Please sign in to comment.