33 lines
616 B
Docker
33 lines
616 B
Docker
FROM --platform=$BUILDPLATFORM node:20-alpine as webbuild
|
|
|
|
COPY . /build
|
|
|
|
WORKDIR /build/frontend
|
|
|
|
RUN npm ci && npm run build
|
|
|
|
FROM --platform=$BUILDPLATFORM golang:1.21-alpine as build
|
|
|
|
ADD . /app
|
|
WORKDIR /app
|
|
|
|
ARG TARGETARCH
|
|
ARG TARGETOS
|
|
|
|
RUN apk add --no-cache make
|
|
|
|
RUN make build BUILD_ARCH="$TARGETARCH" BUILD_OS="$TARGETOS"
|
|
|
|
FROM --platform=$TARGETPLATFORM alpine:latest
|
|
|
|
WORKDIR /data
|
|
RUN apk add --no-cache tzdata ca-certificates
|
|
COPY --from=build /app/build/morningalarm /app/morningalarm
|
|
COPY --from=webbuild /build/frontend/dist /app/public
|
|
|
|
|
|
EXPOSE 3000
|
|
VOLUME [ "/data" ]
|
|
|
|
CMD [ "/app/morningalarm" ]
|