Skip to content

Commit

Permalink
chore: update dev workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistTheNeil committed Feb 20, 2024
1 parent 0d9399e commit 4eb30b5
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .air.compose.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"

[build]
args_bin = []
bin = "./tmp/main"
cmd = "go build -o ./tmp/main ."
delay = 1000
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
exclude_file = []
exclude_regex = ["_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
poll = false
poll_interval = 0
post_cmd = []
pre_cmd = []
rerun = false
rerun_delay = 500
send_interrupt = false
stop_on_error = false

[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"

[log]
main_only = false
time = false

[misc]
clean_on_exit = true

[screen]
clear_on_rebuild = true
keep_scroll = true
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ COPY --from=spa-builder /app/dist /app/internal/router/dist
RUN go build -v -ldflags="-s"
RUN upx /app/rest-geoip

# dev docker image
FROM golang:1.21.3-alpine3.18 AS dev
RUN go install github.com/cosmtrek/air@latest
WORKDIR /app

# Main docker image
FROM alpine:3.18.4
COPY --from=builder /app/rest-geoip /usr/bin/
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ services:
rest-geoip:
build:
context: .
target: dev
volumes:
- .:/app
command: "air -c .air.compose.toml"

0 comments on commit 4eb30b5

Please sign in to comment.