vikunja/Dockerfile

49 lines
1.3 KiB
Docker
Raw Normal View History

# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM node:20.13.1-alpine AS frontendbuilder
2018-09-08 15:08:33 +02:00
WORKDIR /build
ENV PNPM_CACHE_FOLDER .cache/pnpm/
ENV PUPPETEER_SKIP_DOWNLOAD true
ENV CYPRESS_INSTALL_BINARY 0
COPY frontend/ ./
RUN corepack enable && \
pnpm install && \
pnpm run build
FROM --platform=$BUILDPLATFORM techknowlogick/xgo:go-1.21.x AS apibuilder
RUN go install github.com/magefile/mage@latest && \
mv /go/bin/mage /usr/local/go/bin
2018-09-08 15:08:33 +02:00
WORKDIR /go/src/code.vikunja.io/api
COPY . ./
COPY --from=frontendbuilder /build/dist ./frontend/dist
2018-09-08 15:08:33 +02:00
ARG TARGETOS TARGETARCH TARGETVARIANT
2018-09-08 15:08:33 +02:00
ENV GOPROXY https://goproxy.kolaente.de
RUN export PATH=$PATH:$GOPATH/bin && \
mage build:clean && \
mage release:xgo "${TARGETOS}/${TARGETARCH}/${TARGETVARIANT}"
# ┬─┐┬ ┐┌┐┐┌┐┐┬─┐┬─┐
# │┬┘│ │││││││├─ │┬┘
# ┘└┘┘─┘┘└┘┘└┘┴─┘┘└┘
2019-06-02 14:37:10 +00:00
# The actual image
FROM scratch
2018-09-08 15:08:33 +02:00
LABEL maintainer="maintainers@vikunja.io"
WORKDIR /app/vikunja
ENTRYPOINT [ "/app/vikunja/vikunja" ]
2023-02-01 18:39:57 +01:00
EXPOSE 3456
USER 1000
2018-09-08 15:08:33 +02:00
ENV VIKUNJA_SERVICE_ROOTPATH=/app/vikunja/
ENV VIKUNJA_DATABASE_PATH=/db/vikunja.db
COPY --from=apibuilder /build/vikunja-* vikunja
COPY --from=apibuilder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/