2022-11-02 11:24:45 -04:00
|
|
|
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: CC-BY-SA-4.0
|
|
|
|
|
2022-12-11 18:46:30 -05:00
|
|
|
# BASE
|
2024-11-12 15:37:16 -05:00
|
|
|
FROM docker.io/node:20-alpine@sha256:d20da4a7c62a5ef7a3ca2526ebb0912e8c9226a870e0167b4416eb4d3bbda27e AS base
|
2022-12-11 18:46:30 -05:00
|
|
|
RUN apk add --no-cache tini
|
|
|
|
ENTRYPOINT ["tini", "--"]
|
|
|
|
|
2022-11-02 11:24:45 -04:00
|
|
|
# BUILD
|
2022-12-11 18:46:30 -05:00
|
|
|
FROM base AS builder
|
|
|
|
|
2023-10-08 12:55:02 -04:00
|
|
|
RUN apk add --no-cache libc6-compat git
|
2022-11-02 11:24:45 -04:00
|
|
|
ENV NODE_ENV=production
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
|
2023-03-02 15:18:13 -05:00
|
|
|
ENV YARN_CACHE_FOLDER=/tmp/.yarn
|
2022-11-02 11:24:45 -04:00
|
|
|
USER node
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2022-12-11 18:46:30 -05:00
|
|
|
COPY --chown=node . .
|
2022-11-02 11:24:45 -04:00
|
|
|
RUN --mount=type=cache,sharing=locked,uid=1000,gid=1000,target=/tmp/.yarn \
|
2023-02-07 16:03:24 -05:00
|
|
|
yarn install --immutable
|
2022-12-04 16:42:39 -05:00
|
|
|
|
2022-12-11 18:46:30 -05:00
|
|
|
ARG TURBO_TEAM
|
|
|
|
ARG TURBO_API
|
|
|
|
ARG TURBO_TOKEN
|
2022-11-02 11:24:45 -04:00
|
|
|
|
2024-08-31 06:39:15 -04:00
|
|
|
RUN yarn build --filter=@hedgedoc/frontend --no-cache --no-daemon
|
2022-11-02 11:24:45 -04:00
|
|
|
|
|
|
|
# RUNNER
|
2022-12-11 18:46:30 -05:00
|
|
|
FROM base
|
2022-11-02 11:24:45 -04:00
|
|
|
ENV NODE_ENV=production
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
|
2023-02-21 06:54:07 -05:00
|
|
|
LABEL org.opencontainers.image.title='HedgeDoc production frontend image'
|
|
|
|
LABEL org.opencontainers.image.url='https://hedgedoc.org'
|
|
|
|
LABEL org.opencontainers.image.source='https://github.com/hedgedoc/hedgedoc'
|
2024-09-16 10:20:12 -04:00
|
|
|
LABEL org.opencontainers.image.documentation='https://github.com/hedgedoc/hedgedoc/blob/develop/docs/content/how-to/develop/docker.md'
|
2023-02-21 06:54:07 -05:00
|
|
|
LABEL org.opencontainers.image.licenses='AGPL-3.0'
|
|
|
|
|
2022-11-02 11:24:45 -04:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2023-08-26 08:26:47 -04:00
|
|
|
COPY --from=builder --chown=node:node /usr/src/app/frontend/dist ./
|
2022-11-02 11:24:45 -04:00
|
|
|
|
|
|
|
USER node
|
|
|
|
|
|
|
|
ENV PORT 3001
|
|
|
|
EXPOSE 3001/tcp
|
2023-02-04 08:44:57 -05:00
|
|
|
|
|
|
|
WORKDIR /usr/src/app/frontend
|
|
|
|
CMD ["node", "server.js"]
|