feat: Add development environment configuration with Docker Compose and Dockerfile

This commit is contained in:
yusing
2025-09-08 09:15:24 +08:00
parent abeb26b556
commit 52e949de85
3 changed files with 83 additions and 3 deletions

33
dev.Dockerfile Normal file
View File

@@ -0,0 +1,33 @@
# Stage 1: deps
FROM golang:1.25.0-alpine AS deps
HEALTHCHECK NONE
# package version does not matter
# trunk-ignore(hadolint/DL3018)
RUN apk add --no-cache tzdata make libcap-setcap
# Stage 3: Final image
FROM alpine:3.22
LABEL maintainer="yusing@6uo.me"
LABEL proxy.exclude=1
# copy timezone data
COPY --from=deps /usr/share/zoneinfo /usr/share/zoneinfo
# copy certs
COPY --from=deps /etc/ssl/certs /etc/ssl/certs
ARG TARGET
ENV TARGET=${TARGET}
ENV DOCKER_HOST=unix:///var/run/docker.sock
# copy binary
COPY bin/${TARGET} /app/run
WORKDIR /app
RUN chown -R 1000:1000 /app
CMD ["/app/run"]