Fix: Docker unify all the builds (air and production) within tmp/

This commit is contained in:
Óscar M. Lage 2024-11-28 23:02:41 +01:00
parent 0be66aab74
commit a52a8393a1
5 changed files with 9 additions and 10 deletions

View File

@ -1,8 +1,8 @@
root = "." root = "."
tmp_dir = "tmp_bot" tmp_dir = "tmp"
[build] [build]
cmd = "go build -o ./tmp_bot/main ./cmd/bot/main.go" cmd = "go build -o ./tmp/main_bot ./cmd/bot/main.go"
bin = "./tmp_bot/main" bin = "./tmp/main_bot"
delay = 1000 delay = 1000

View File

@ -1,8 +1,8 @@
root = "." root = "."
tmp_dir = "tmp_web" tmp_dir = "tmp"
[build] [build]
cmd = "go build -o ./tmp_web/main ./cmd/web/main.go" cmd = "go build -o ./tmp/main_web ./cmd/web/main.go"
bin = "./tmp_web/main" bin = "./tmp/main_web"
delay = 1000 delay = 1000

3
.gitignore vendored
View File

@ -1,4 +1,3 @@
data data
.env .env
tmp_bot tmp
tmp_web

View File

@ -24,5 +24,5 @@ CMD if [ "$DOCKER_ENV" = "local" ]; then \
air -c .air.bot.toml; \ air -c .air.bot.toml; \
else \ else \
echo "Production environment detected, building and running bot..."; \ echo "Production environment detected, building and running bot..."; \
go build -o bot ./cmd/bot/main.go && ./bot; \ go build -o tmp/bot ./cmd/bot/main.go && ./tmp/bot; \
fi fi

View File

@ -24,5 +24,5 @@ CMD if [ "$DOCKER_ENV" = "local" ]; then \
air -c .air.web.toml; \ air -c .air.web.toml; \
else \ else \
echo "Production environment detected, building and running web..."; \ echo "Production environment detected, building and running web..."; \
go build -o web ./cmd/web/main.go && ./web; \ go build -o tmp/web ./cmd/web/main.go && ./tmp/web; \
fi fi