2022-07-25 10:36:28 -04:00
|
|
|
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: CC-BY-SA-4.0
|
|
|
|
|
|
|
|
# BUILD
|
2022-07-31 14:31:33 -04:00
|
|
|
FROM node:18-alpine AS builder
|
2022-08-30 06:28:53 -04:00
|
|
|
ARG BUILD_VERSION=CLIENT_VERSION_MISSING
|
2022-07-25 10:36:28 -04:00
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
|
2022-07-31 14:31:33 -04:00
|
|
|
WORKDIR /app
|
|
|
|
COPY . ./
|
2022-07-25 10:36:28 -04:00
|
|
|
RUN yarn install --immutable && \
|
2022-08-30 06:28:53 -04:00
|
|
|
sed -i "s/CLIENT_VERSION_MISSING/${BUILD_VERSION}/" src/version.json && \
|
2022-07-31 14:31:33 -04:00
|
|
|
yarn build:for-real-backend
|
2022-07-25 10:36:28 -04:00
|
|
|
|
|
|
|
# RUNNER
|
2022-07-31 14:31:33 -04:00
|
|
|
FROM node:18-alpine
|
2022-07-25 10:36:28 -04:00
|
|
|
ENV NODE_ENV=production
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
|
|
|
|
WORKDIR /app
|
2022-07-31 14:31:33 -04:00
|
|
|
|
2022-08-01 08:00:04 -04:00
|
|
|
COPY --from=builder /app/next.config.js ./
|
|
|
|
COPY --from=builder /app/public ./public
|
2022-07-31 14:31:33 -04:00
|
|
|
COPY --from=builder --chown=node:node /app/.next/static ./.next/static
|
2022-08-01 08:00:04 -04:00
|
|
|
COPY --from=builder --chown=node:node /app/.next/standalone ./
|
2022-07-31 14:31:33 -04:00
|
|
|
|
2022-07-25 10:36:28 -04:00
|
|
|
USER node
|
|
|
|
|
2022-08-01 08:42:54 -04:00
|
|
|
ENV PORT 3000
|
|
|
|
EXPOSE 3000/tcp
|
2022-07-31 14:31:33 -04:00
|
|
|
CMD ["node", "server.js"]
|