2023-01-31 16:16:21 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
2024-02-09 12:41:34 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM node:20.11.0-alpine AS frontendbuilder
|
2018-09-08 13:08:33 +00:00
|
|
|
|
2024-02-09 12:41:34 +00:00
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
ENV PNPM_CACHE_FOLDER .cache/pnpm/
|
|
|
|
ENV PUPPETEER_SKIP_DOWNLOAD true
|
|
|
|
|
|
|
|
COPY frontend/ ./
|
|
|
|
|
|
|
|
RUN corepack enable && \
|
|
|
|
pnpm install && \
|
|
|
|
pnpm run build
|
|
|
|
|
|
|
|
FROM --platform=$BUILDPLATFORM techknowlogick/xgo:go-1.21.x AS apibuilder
|
2022-08-03 15:54:21 +00:00
|
|
|
|
2023-01-31 16:16:21 +00:00
|
|
|
RUN go install github.com/magefile/mage@latest && \
|
|
|
|
mv /go/bin/mage /usr/local/go/bin
|
2018-09-08 13:08:33 +00:00
|
|
|
|
2022-08-03 10:44:18 +00:00
|
|
|
WORKDIR /go/src/code.vikunja.io/api
|
2023-01-31 16:16:21 +00:00
|
|
|
COPY . ./
|
2024-02-09 12:41:34 +00:00
|
|
|
COPY --from=frontendbuilder /build/dist ./frontend/dist
|
2018-09-08 13:08:33 +00:00
|
|
|
|
2022-11-12 13:29:57 +00:00
|
|
|
ARG TARGETOS TARGETARCH TARGETVARIANT
|
2018-09-08 13:08:33 +00:00
|
|
|
|
2023-09-12 11:34:35 +00:00
|
|
|
ENV GOPROXY https://goproxy.kolaente.de
|
2023-04-02 16:55:30 +00:00
|
|
|
RUN export PATH=$PATH:$GOPATH/bin && \
|
|
|
|
mage build:clean && \
|
2023-01-31 16:16:21 +00:00
|
|
|
mage release:xgo "${TARGETOS}/${TARGETARCH}/${TARGETVARIANT}"
|
|
|
|
|
|
|
|
# ┬─┐┬ ┐┌┐┐┌┐┐┬─┐┬─┐
|
|
|
|
# │┬┘│ │││││││├─ │┬┘
|
|
|
|
# ┘└┘┘─┘┘└┘┘└┘┴─┘┘└┘
|
|
|
|
|
2019-06-02 14:37:10 +00:00
|
|
|
# The actual image
|
|
|
|
# Note: I wanted to use the scratch image here, but unfortunatly the go-sqlite bindings require cgo and
|
2019-11-24 17:36:43 +00:00
|
|
|
# because of this, the container would not start when I compiled the image without cgo.
|
2023-12-19 15:03:45 +00:00
|
|
|
FROM alpine:3.19 AS runner
|
2018-09-08 13:08:33 +00:00
|
|
|
LABEL maintainer="maintainers@vikunja.io"
|
2023-01-31 16:16:21 +00:00
|
|
|
WORKDIR /app/vikunja
|
|
|
|
ENTRYPOINT [ "/sbin/tini", "-g", "--", "/entrypoint.sh" ]
|
2023-02-01 17:39:57 +00:00
|
|
|
EXPOSE 3456
|
2018-09-08 13:08:33 +00:00
|
|
|
|
2018-11-02 10:01:28 +00:00
|
|
|
ENV VIKUNJA_SERVICE_ROOTPATH=/app/vikunja/
|
2020-05-22 19:18:11 +00:00
|
|
|
ENV PUID 1000
|
|
|
|
ENV PGID 1000
|
2023-01-31 16:16:21 +00:00
|
|
|
|
2023-02-15 09:39:48 +00:00
|
|
|
RUN apk --update --no-cache add tzdata tini shadow && \
|
|
|
|
addgroup vikunja && \
|
|
|
|
adduser -s /bin/sh -D -G vikunja vikunja -h /app/vikunja -H
|
2023-01-31 16:16:21 +00:00
|
|
|
COPY docker/entrypoint.sh /entrypoint.sh
|
|
|
|
RUN chmod 0755 /entrypoint.sh && mkdir files
|
|
|
|
|
2024-02-09 12:41:34 +00:00
|
|
|
COPY --from=apibuilder /build/vikunja-* vikunja
|