2023-01-29 14:47:22 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
# ┬─┐┬ ┐o┬ ┬─┐
|
|
|
|
# │─││ │││ │ │
|
|
|
|
# ┘─┘┘─┘┘┘─┘┘─┘
|
|
|
|
|
2024-01-16 11:49:00 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM node:20.11.0-alpine AS builder
|
2020-04-19 17:27:15 +00:00
|
|
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
2020-12-16 19:23:38 +00:00
|
|
|
ARG USE_RELEASE=false
|
2023-06-16 18:07:43 +00:00
|
|
|
ARG RELEASE_VERSION=unstable
|
2022-09-30 17:13:06 +00:00
|
|
|
ENV PNPM_CACHE_FOLDER .cache/pnpm/
|
2023-09-04 11:07:48 +00:00
|
|
|
ENV PUPPETEER_SKIP_DOWNLOAD true
|
2020-04-19 17:27:15 +00:00
|
|
|
|
2023-01-29 14:47:22 +00:00
|
|
|
COPY package.json ./
|
|
|
|
COPY pnpm-lock.yaml ./
|
2023-06-16 18:35:08 +00:00
|
|
|
COPY patches ./patches/
|
2023-01-29 14:47:22 +00:00
|
|
|
|
|
|
|
RUN if [ "$USE_RELEASE" != true ]; then \
|
|
|
|
# https://pnpm.io/installation#using-corepack
|
|
|
|
corepack enable && \
|
|
|
|
pnpm install; \
|
|
|
|
fi
|
2019-06-10 20:12:58 +00:00
|
|
|
|
2023-01-29 14:47:22 +00:00
|
|
|
COPY . ./
|
2020-05-22 16:11:20 +00:00
|
|
|
|
2023-01-29 14:47:22 +00:00
|
|
|
RUN if [ "$USE_RELEASE" != true ]; then \
|
|
|
|
apk add --no-cache --virtual .build-deps git jq && \
|
|
|
|
git describe --tags --always --abbrev=10 | sed 's/-/+/; s/^v//; s/-g/-/' | \
|
|
|
|
xargs -0 -I{} jq -Mcnr --arg version {} '{VERSION:$version}' | \
|
|
|
|
tee src/version.json && \
|
|
|
|
apk del .build-deps; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
RUN if [ "$USE_RELEASE" = true ]; then \
|
|
|
|
wget "https://dl.vikunja.io/frontend/vikunja-frontend-${RELEASE_VERSION}.zip" -O frontend-release.zip && \
|
|
|
|
unzip frontend-release.zip -d dist/; \
|
|
|
|
else \
|
|
|
|
# we don't use corepack prepare here by intend since
|
|
|
|
# we have renovate to keep our dependencies up to date
|
|
|
|
# Build the frontend
|
|
|
|
pnpm run build; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
# ┌┐┐┌─┐o┌┐┐┐ │
|
|
|
|
# ││││ ┬││││┌┼┘
|
|
|
|
# ┘└┘┘─┘┘┘└┘┘ └
|
|
|
|
|
|
|
|
FROM nginx:stable-alpine AS runner
|
|
|
|
WORKDIR /usr/share/nginx/html
|
2020-05-05 21:31:01 +00:00
|
|
|
LABEL maintainer="maintainers@vikunja.io"
|
|
|
|
|
2023-01-29 14:47:22 +00:00
|
|
|
ENV VIKUNJA_HTTP_PORT 80
|
|
|
|
ENV VIKUNJA_HTTP2_PORT 81
|
|
|
|
ENV VIKUNJA_LOG_FORMAT main
|
2023-02-09 21:30:36 +00:00
|
|
|
ENV VIKUNJA_API_URL /api/v1
|
2023-01-29 14:47:22 +00:00
|
|
|
ENV VIKUNJA_SENTRY_ENABLED false
|
|
|
|
ENV VIKUNJA_SENTRY_DSN https://85694a2d757547cbbc90cd4b55c5a18d@o1047380.ingest.sentry.io/6024480
|
2023-04-12 08:39:10 +00:00
|
|
|
ENV VIKUNJA_PROJECT_INFINITE_NESTING_ENABLED false
|
2023-06-02 11:51:29 +00:00
|
|
|
ENV VIKUNJA_ALLOW_ICON_CHANGES true
|
2023-09-04 08:22:39 +00:00
|
|
|
ENV VIKUNJA_CUSTOM_LOGO_URL "''"
|
2022-04-09 18:00:29 +00:00
|
|
|
|
2023-01-29 14:47:22 +00:00
|
|
|
COPY docker/injector.sh /docker-entrypoint.d/50-injector.sh
|
2023-02-03 14:55:36 +00:00
|
|
|
COPY docker/ipv6-disable.sh /docker-entrypoint.d/60-ipv6-disable.sh
|
2023-01-29 14:47:22 +00:00
|
|
|
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
|
|
|
COPY docker/templates/. /etc/nginx/templates/
|
|
|
|
# copy compiled files from stage 1
|
|
|
|
COPY --from=builder /build/dist ./
|
|
|
|
# manage permissions
|
|
|
|
RUN chmod 0755 /docker-entrypoint.d/*.sh /etc/nginx/templates && \
|
|
|
|
chmod -R 0644 /etc/nginx/nginx.conf && \
|
2023-01-27 08:57:35 +00:00
|
|
|
chown -R nginx:nginx ./ /etc/nginx/conf.d /etc/nginx/templates && \
|
|
|
|
rm -f /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
|