mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-22 23:11:01 +00:00
762a0a850e
Doing this BEFORE the merge prevents a lot of merge conflicts. Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
35 lines
847 B
Docker
35 lines
847 B
Docker
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
#
|
|
# SPDX-License-Identifier: CC-BY-SA-4.0
|
|
|
|
# BUILD
|
|
FROM node:18-alpine AS builder
|
|
ENV NODE_ENV=production
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
ARG BUILD_VERSION=CLIENT_VERSION_MISSING
|
|
|
|
WORKDIR /app
|
|
COPY . ./
|
|
RUN rm -rf public/public && \
|
|
rm -rf src/pages/api && \
|
|
yarn install --immutable && \
|
|
sed -i "s/CLIENT_VERSION_MISSING/${BUILD_VERSION}/" src/version.json && \
|
|
yarn build
|
|
|
|
# RUNNER
|
|
FROM node:18-alpine
|
|
ENV NODE_ENV=production
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/next.config.js ./
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder --chown=node:node /app/.next/static ./.next/static
|
|
COPY --from=builder --chown=node:node /app/.next/standalone ./
|
|
|
|
USER node
|
|
|
|
ENV PORT 3001
|
|
EXPOSE 3001/tcp
|
|
CMD ["node", "server.js"]
|