forked from mdouchement/standardfile
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Earthfile
30 lines (26 loc) · 820 Bytes
/
Earthfile
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
VERSION 0.7
build-all:
BUILD --platform=linux/amd64 +build
BUILD --platform=linux/arm64/v8 +build
build:
ARG TARGETARCH
ARG TARGETVARIANT
FROM alpine
ENV DATABASE_PATH /data/database
RUN mkdir -p ${DATABASE_PATH}
COPY (+compile-binary/bin --GOARCH=$TARGETARCH) /usr/local/bin/standardnote
EXPOSE 5000
CMD ["standardnote", "server", "-c", "/etc/standardfile/standardfile.yml"]
SAVE IMAGE --push docker.io/crusaders/standardnote-server:latest
compile-binary:
ARG GOARCH
FROM --platform=linux/amd64 golang:1.20-alpine
COPY --dir . /build
ENV CGO_ENABLED 0
ENV GO111MODULE on
ENV GOPROXY https://proxy.golang.org
ENV GOOS=linux
WORKDIR /build/cmd/standardfile
RUN go mod download
RUN go build -o /build/bin
SAVE ARTIFACT /build/bin