-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (25 loc) · 756 Bytes
/
Dockerfile
File metadata and controls
38 lines (25 loc) · 756 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
37
38
ARG GO_VERSION=1.24-alpine3.21
ARG FROM_IMAGE=alpine:3.22
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS builder
ARG TARGETOS
ARG TARGETARCH
ARG VERSION
LABEL org.opencontainers.image.source = "https://github.com/counterapi/api"
RUN apk update && \
apk add ca-certificates gettext git make && \
rm -rf /tmp/* && \
rm -rf /var/cache/apk/* && \
rm -rf /var/tmp/*
COPY ./ /app
WORKDIR /app
RUN make build TARGETOS=$TARGETOS TARGETARCH=$TARGETARCH VERSION=$VERSION
FROM ${FROM_IMAGE}
ENV GIN_MODE release
RUN apk update && \
apk add ca-certificates openssl && \
rm -rf /tmp/* && \
rm -rf /var/cache/apk/* && \
rm -rf /var/tmp/*
COPY --from=builder /app/dist/counterapi /bin/counterapi
EXPOSE 80
ENTRYPOINT ["counterapi"]