Use Air for live go rebuild
This commit is contained in:
parent
be15276bb5
commit
9c21a4a77b
3 changed files with 31 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -211,3 +211,4 @@ docs/
|
|||
templates/openapi/
|
||||
|
||||
dist/
|
||||
tmp/
|
||||
|
|
14
Dockerfile.dev
Normal file
14
Dockerfile.dev
Normal file
|
@ -0,0 +1,14 @@
|
|||
FROM golang:1.20-alpine
|
||||
RUN apk add --update --no-cache tzdata
|
||||
|
||||
RUN go install github.com/cosmtrek/air@latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
ENV VERSION=v0.0.0-DEV
|
||||
ENV DATE=2023-04-05T20:48:07Z
|
||||
|
||||
CMD ["air", "-c", ".air.toml"]
|
16
docker-compose.yml
Normal file
16
docker-compose.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
services:
|
||||
godash:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.dev
|
||||
container_name: godash
|
||||
restart: always
|
||||
entrypoint: air --build.exclude_dir "node_modules,static,docs,storage,tmp,dist"
|
||||
environment:
|
||||
- TZ=Europe/Berlin
|
||||
- LOG_LEVEL=debug
|
||||
- TITLE=DEV
|
||||
ports:
|
||||
- 4000:4000
|
||||
volumes:
|
||||
- ./:/app/:rw
|
Loading…
Add table
Reference in a new issue