mirror of
https://github.com/cuigh/swirl
synced 2024-12-30 15:53:24 +00:00
Add compose file
This commit is contained in:
parent
bbce4dbd35
commit
918fd82ea5
2
Gopkg.lock
generated
2
Gopkg.lock
generated
@ -23,7 +23,7 @@
|
|||||||
branch = "master"
|
branch = "master"
|
||||||
name = "github.com/cuigh/auxo"
|
name = "github.com/cuigh/auxo"
|
||||||
packages = [".","app","app/flag","byte/size","cache","cache/memory","config","data","data/guid","data/valid","encoding/yaml","errors","ext/files","ext/reflects","ext/texts","ext/times","log","log/console","log/file","net/web","net/web/filter","net/web/filter/auth","net/web/renderer","net/web/renderer/jet","net/web/router","security","security/passwd","util/cast","util/debug","util/i18n","util/lazy"]
|
packages = [".","app","app/flag","byte/size","cache","cache/memory","config","data","data/guid","data/valid","encoding/yaml","errors","ext/files","ext/reflects","ext/texts","ext/times","log","log/console","log/file","net/web","net/web/filter","net/web/filter/auth","net/web/renderer","net/web/renderer/jet","net/web/router","security","security/passwd","util/cast","util/debug","util/i18n","util/lazy"]
|
||||||
revision = "884fa635c732cc5a6f5e43f590e9393f7b789637"
|
revision = "f599f84ec7ef56f01457d0fb0d8eeb9d8c100b43"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
|
@ -113,6 +113,12 @@ docker service create \
|
|||||||
cuigh/swirl
|
cuigh/swirl
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Docker compose
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker stack deploy -c compose.yml swirl
|
||||||
|
```
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
**Swirl** use `dep` as dependency management tool. You can build **Swirl**
|
**Swirl** use `dep` as dependency management tool. You can build **Swirl**
|
||||||
|
34
compose.yml
Normal file
34
compose.yml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
swirl:
|
||||||
|
image: cuigh/swirl
|
||||||
|
environment:
|
||||||
|
DB_ADDRESS: mongo:27017/swirl
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
ports:
|
||||||
|
- 8001:8001
|
||||||
|
networks:
|
||||||
|
- net
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
placement:
|
||||||
|
constraints: [node.role == manager]
|
||||||
|
|
||||||
|
mongo:
|
||||||
|
image: mongo
|
||||||
|
volumes:
|
||||||
|
- mongo:/data/db
|
||||||
|
networks:
|
||||||
|
- net
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
# placement:
|
||||||
|
# constraints: [node.hostname == mongo]
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mongo:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
net:
|
14
main.go
14
main.go
@ -61,13 +61,13 @@ func server() *web.Server {
|
|||||||
|
|
||||||
// set render
|
// set render
|
||||||
ws.Validator = &valid.Validator{Tag: "valid"}
|
ws.Validator = &valid.Validator{Tag: "valid"}
|
||||||
ws.Renderer = jet.New().SetDebug(config.GetBool("debug")).
|
ws.Renderer = jet.Must(jet.Debug(config.GetBool("debug")), jet.VarMap(misc.Funcs), jet.VarMap(map[string]interface{}{
|
||||||
AddFunc("time", misc.FormatTime(setting.TimeZone.Offset)).
|
"language": setting.Language,
|
||||||
AddFunc("i18n", misc.Message(setting.Language)).
|
"version": app.Version,
|
||||||
AddFuncs(misc.Funcs).
|
"go_version": runtime.Version(),
|
||||||
AddVariable("language", setting.Language).
|
"time": misc.FormatTime(setting.TimeZone.Offset),
|
||||||
AddVariable("version", app.Version).
|
"i18n": misc.Message(setting.Language),
|
||||||
AddVariable("go_version", runtime.Version())
|
}))
|
||||||
|
|
||||||
// register global filters
|
// register global filters
|
||||||
ws.Use(filter.NewRecover())
|
ws.Use(filter.NewRecover())
|
||||||
|
Loading…
Reference in New Issue
Block a user