serve frontend + backend as a one binary

This commit is contained in:
2024-11-19 17:16:36 +05:30
parent 5954ec2501
commit e378db58b8
14 changed files with 87 additions and 26 deletions

View File

@@ -1,9 +1,12 @@
version: '3'
dotenv: ['.env.{{.ENV}}']
env:
ENV: development
dotenv: ['.env.{{.ENV}}']
vars:
MOD_NAME: gitserver.in/patialtech/rano
tasks:
install:
@@ -14,7 +17,7 @@ tasks:
start-graph:
desc: run graph server
cmds:
- cmd: go run ./cmd/server
- cmd: go run ./bin/server
start-web:
desc: run web in dev mode
@@ -44,11 +47,11 @@ tasks:
- cmd: deno task codegen
ent-new:
desc: create new db Emtity
cmd: cd ./db && go run -mod=mod entgo.io/ent/cmd/ent new {{.name}}
desc: create new db Entity
cmd: cd ./db && go run -mod=mod entry.io/ent/cmd/ent new {{.name}}
ent-gen:
desc: genertate from ent schema
desc: generate from ent schema
cmds:
- go generate ./db/ent
@@ -61,4 +64,17 @@ tasks:
desc: apply automatically migration using Ent schema
cmds:
- task: ent-gen
- go run ./cmd/migrate-up
- go run ./bin/migrate-up
build-web-prod:
desc: apply automatically migration using Ent schema
cmds:
- deno task build
env:
ASSETS_HOST:
build-prod:
desc: apply automatically migration using Ent schema
cmds:
- task: build-web-prod
- CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -ldflags "-X '{{.MOD_NAME}}/config.AppEnv=production'" -o ./server ./bin/server