-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDockerfile.dev
More file actions
36 lines (27 loc) · 754 Bytes
/
Dockerfile.dev
File metadata and controls
36 lines (27 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Development Dockerfile with hot reload
FROM golang:1.25-alpine
# Install development tools
RUN apk add --no-cache \
git \
make \
bash \
curl
# Install air for hot reload
RUN go install github.com/cosmtrek/air@latest
# Install golangci-lint
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b $(go env GOPATH)/bin latest
# Install goimports
RUN go install golang.org/x/tools/cmd/goimports@latest
# Set working directory
WORKDIR /app
# Copy go mod files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Create air config if it doesn't exist
RUN if [ ! -f .air.toml ]; then \
air init; \
fi
# Default command runs air for hot reload
CMD ["air"]