Use Air for live go rebuild

This commit is contained in:
Florian Hoss 2023-04-16 16:03:18 +02:00
parent be15276bb5
commit 9c21a4a77b
3 changed files with 31 additions and 0 deletions

1
.gitignore vendored
View file

@ -211,3 +211,4 @@ docs/
templates/openapi/
dist/
tmp/

14
Dockerfile.dev Normal file
View 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
View 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