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
|
|
|
|
RUN chown node:node -R /app
|
2022-07-31 18:31:33 +00:00
|
|
|
|
|
|
|
COPY --from=builder --chown=node:node /app/.next/standalone ./
|
|
|
|
COPY --from=builder --chown=node:node /app/.next/static ./.next/static
|
|
|
|
COPY --from=builder /app/public ./public
|
|
|
|
COPY --from=builder /app/package.json ./package.json
|
|
|
|
|
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"]
|