2022-07-25 14:36:28 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: CC-BY-SA-4.0
|
|
|
|
|
|
|
|
# BUILD
|
2022-07-31 18:31:33 +00:00
|
|
|
FROM node:18-alpine AS builder
|
2022-07-25 14:36:28 +00:00
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
|
2022-07-31 18:31:33 +00:00
|
|
|
WORKDIR /app
|
|
|
|
COPY . ./
|
2022-07-25 14:36:28 +00:00
|
|
|
RUN yarn install --immutable && \
|
2022-07-31 18:31:33 +00:00
|
|
|
yarn build:for-real-backend
|
2022-07-25 14:36:28 +00:00
|
|
|
|
|
|
|
# RUNNER
|
2022-07-31 18:31:33 +00:00
|
|
|
FROM node:18-alpine
|
2022-07-25 14:36:28 +00:00
|
|
|
ENV NODE_ENV=production
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
|
|
|
|
WORKDIR /app
|
2022-07-31 18:31:33 +00:00
|
|
|
|
2022-08-01 12:00:04 +00:00
|
|
|
COPY --from=builder /app/next.config.js ./
|
|
|
|
COPY --from=builder /app/public ./public
|
2022-07-31 18:31:33 +00:00
|
|
|
COPY --from=builder --chown=node:node /app/.next/static ./.next/static
|
2022-08-01 12:00:04 +00:00
|
|
|
COPY --from=builder --chown=node:node /app/.next/standalone ./
|
2022-07-31 18:31:33 +00:00
|
|
|
|
2022-07-25 14:36:28 +00:00
|
|
|
USER node
|
|
|
|
|
|
|
|
EXPOSE 3001/tcp
|
2022-07-31 18:31:33 +00:00
|
|
|
CMD ["node", "server.js"]
|