-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (28 loc) · 1.36 KB
/
Dockerfile
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
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder
ARG MODULE=github.com/betterde/focusly
ARG BINARY_NAME=focusly
ARG BUILD_VERSION=latest
ARG INSTALL_PATH=/usr/local/bin
RUN apk add --update gcc git make
ENV GOPATH=/tmp/buildcache
COPY . /go/src/focusly
WORKDIR /go/src/focusly
RUN CGO_ENABLED=0 go build -ldflags "-s -w -X '${MODULE}/cmd.version=${BUILD_VERSION}' -X '${MODULE}/cmd.build=`date -u`' -X '${MODULE}/cmd.commit=`git rev-parse HEAD`'" -o bin/${BINARY_NAME} main.go
FROM --platform=$BUILDPLATFORM alpine:latest
ARG BUILD_VERSION=latest
ENV VERSION=${BUILD_VERSION}
LABEL org.opencontainers.image.url="https://github.com/betterde/focusly"
LABEL org.opencontainers.image.titile="focusly"
LABEL org.opencontainers.image.vendor="Betterde Inc."
LABEL org.opencontainers.image.source="https://github.com/betterde/focusly"
LABEL org.opencontainers.image.version="${VERSION}"
LABEL org.opencontainers.image.authors="George <[email protected]>"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.description="An open source team collaboration system developed based on Go."
LABEL org.opencontainers.image.documentation="https://github.com/betterde/focusly"
COPY --from=builder /go/src/focusly/bin/focusly /usr/local/bin/focusly
RUN mkdir -p /etc/focusly
WORKDIR /root/
VOLUME ["/etc/focusly"]
ENTRYPOINT ["/usr/local/bin/focusly"]
EXPOSE 443