aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--application_router.go5
-rw-r--r--docker-compose.yml24
-rw-r--r--go.mod1
-rw-r--r--go.sum2
4 files changed, 31 insertions, 1 deletions
diff --git a/application_router.go b/application_router.go
index ea68e9d..bd876da 100644
--- a/application_router.go
+++ b/application_router.go
@@ -3,6 +3,7 @@ package main
import (
"errors"
"fmt"
+ "github.com/gin-gonic/contrib/static"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
"net/http"
@@ -17,7 +18,7 @@ func CreateApplicationRouter(applicationContext *ApplicationContext) *gin.Engine
router.Use(gin.Recovery())
router.MaxMultipartMemory = 8 << 30
- // engine.Static("/", "./frontend/build")
+ router.Use(static.Serve("/", static.LocalFile("./frontend/build", true)))
router.POST("/setup", func(c *gin.Context) {
if applicationContext.IsConfigured {
@@ -280,6 +281,8 @@ func CreateApplicationRouter(applicationContext *ApplicationContext) *gin.Engine
})
}
+
+
return router
}
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..5d6813c
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,24 @@
+version: "3.7"
+services:
+
+ mongo:
+ image: mongo:4
+ networks:
+ - acheronet
+ restart: always
+
+ caronte:
+ build:
+ context: .
+ dockerfile: Dockerfile
+ image: caronte
+ ports:
+ - "80:3333"
+ depends_on:
+ - mongo
+ networks:
+ - acheronet
+ command: ./caronte -mongo-host mongo -mongo-port 27017
+
+networks:
+ acheronet:
diff --git a/go.mod b/go.mod
index 6c6c0bc..1281ae8 100644
--- a/go.mod
+++ b/go.mod
@@ -4,6 +4,7 @@ go 1.14
require (
github.com/flier/gohs v1.0.0
+ github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607
github.com/gin-gonic/gin v1.6.2
github.com/go-playground/validator/v10 v10.2.0
github.com/golang/protobuf v1.3.5 // indirect
diff --git a/go.sum b/go.sum
index bd950b9..d17dea6 100644
--- a/go.sum
+++ b/go.sum
@@ -6,6 +6,8 @@ github.com/flier/gohs v1.0.0 h1:Q0mmufGWTigzKb140WmJ0+k3EGAf335Qgv/pz5SOPvU=
github.com/flier/gohs v1.0.0/go.mod h1:Jlg6A1xXSMhPorF74/LkYHkCHZ87Txi8CqIHHyIKgKg=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
+github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607 h1:MrIm8EEPue08JS4eh+b08IOG+wd0WRWEHWnewNfWFX0=
+github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607/go.mod h1:iqneQ2Df3omzIVTkIfn7c1acsVnMGiSLn4XF5Blh3Yg=
github.com/gin-gonic/gin v1.6.2 h1:88crIK23zO6TqlQBt+f9FrPJNKm9ZEr7qjp9vl/d5TM=
github.com/gin-gonic/gin v1.6.2/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=