morningalarm/Dockerfile

33 lines
616 B
Docker
Raw Normal View History

2023-11-07 00:21:12 +01:00
FROM --platform=$BUILDPLATFORM node:20-alpine as webbuild
COPY . /build
WORKDIR /build/frontend
RUN npm ci && npm run build
2023-08-25 22:44:44 +02:00
FROM --platform=$BUILDPLATFORM golang:1.21-alpine as build
ADD . /app
WORKDIR /app
2023-08-27 15:11:28 +02:00
ARG TARGETARCH
ARG TARGETOS
2023-09-13 16:28:19 +02:00
RUN apk add --no-cache make
2023-08-25 22:44:44 +02:00
RUN make build BUILD_ARCH="$TARGETARCH" BUILD_OS="$TARGETOS"
FROM --platform=$TARGETPLATFORM alpine:latest
2023-09-13 16:28:19 +02:00
2023-08-25 22:44:44 +02:00
WORKDIR /data
2023-09-13 16:28:19 +02:00
RUN apk add --no-cache tzdata ca-certificates
2023-08-25 22:44:44 +02:00
COPY --from=build /app/build/morningalarm /app/morningalarm
2023-11-07 00:21:12 +01:00
COPY --from=webbuild /build/frontend/dist /app/public
2023-08-25 22:44:44 +02:00
EXPOSE 3000
VOLUME [ "/data" ]
CMD [ "/app/morningalarm" ]