forked from DataDog/stickerlandia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
29 lines (21 loc) · 885 Bytes
/
Copy pathDockerfile.dev
File metadata and controls
29 lines (21 loc) · 885 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
# Development Dockerfile for Sticker Award service
# Provides hot-reload via Air and debugging via Delve
# Use docker-compose.dev.yml in the stickerlandia root to use this!
FROM golang:1.25-alpine
ARG GIT_COMMIT_SHA
ARG GIT_REPOSITORY_URL
ENV DD_GIT_REPOSITORY_URL=${GIT_REPOSITORY_URL}
ENV DD_GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
# Install OS dependencies and dev tools
RUN apk add --no-cache git bash curl tzdata \
&& go install github.com/air-verse/air@v1.63.1 \
&& go install github.com/go-delve/delve/cmd/dlv@latest
# The working directory mirrors the bind-mount from the host
WORKDIR /app
# Leverage Docker layer caching by copying only go mod files first
COPY go.mod go.sum ./
RUN go mod download
# Expose HTTP port and Delve debug port
EXPOSE 8080 2345
# Start Air, which watches for file changes, rebuilds, and restarts the binary
CMD ["air", "-c", ".air.toml"]