mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
Add Dockerfile
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
5a1e4f406e
commit
85aa5f6c50
1 changed files with 34 additions and 0 deletions
34
Dockerfile
Normal file
34
Dockerfile
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: CC-BY-SA-4.0
|
||||||
|
|
||||||
|
# BUILD
|
||||||
|
|
||||||
|
FROM node:18 AS builder
|
||||||
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
RUN chown -R node:node . /usr/src/app
|
||||||
|
USER node
|
||||||
|
COPY --chown=node . ./
|
||||||
|
RUN yarn install --immutable && \
|
||||||
|
yarn build:for-real-backend && \
|
||||||
|
rm -rf .next/cache
|
||||||
|
|
||||||
|
# RUNNER
|
||||||
|
|
||||||
|
FROM node:18-slim
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
RUN chown node:node -R /app
|
||||||
|
COPY --chown=node package.json yarn.lock .yarnrc.yml ./
|
||||||
|
COPY --chown=node .yarn/ .yarn/
|
||||||
|
COPY --chown=node public/ public/
|
||||||
|
COPY --chown=node --from=builder /usr/src/app/.next/ .next/
|
||||||
|
USER node
|
||||||
|
RUN yarn workspaces focus --all --production && rm -rf .yarn/cache
|
||||||
|
|
||||||
|
EXPOSE 3001/tcp
|
||||||
|
CMD ["/usr/local/bin/yarn", "start:for-real-backend"]
|
Loading…
Reference in a new issue