Files
outline-ru/Dockerfile.prod
T
Evgeny daa7561aff
Build / Build [amd64] (push) Has been cancelled
Build / Build [arm64] (push) Has been cancelled
Build / Publish (push) Has been cancelled
1.0.0 (#26)
* bump outline to 1.0.0-2

* update translation.json

* update readme.*

* update Dockerfile*

* bump outline to 1.0.0-test8

* reorganize repo, add git hook

* bump version to 1.0.0

* update translations
2025-10-27 17:47:11 +05:00

52 lines
1.7 KiB
Docker

FROM node:22 AS base
ARG APP_PATH
ARG SRC_PATH
WORKDIR $APP_PATH
FROM base AS deps
COPY ${SRC_PATH}/package.json ${SRC_PATH}/yarn.lock ./
RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \
yarn cache clean
FROM base AS build
RUN apt-get update && \
apt-get install -y patch cmake && \
rm -rf /var/lib/apt/lists/*
COPY ${SRC_PATH}/patches ./patches
COPY ${SRC_PATH}/package.json ${SRC_PATH}/yarn.lock ./
ENV NODE_OPTIONS="--max-old-space-size=24000"
RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \
yarn cache clean
COPY ${SRC_PATH} .
COPY ./patches/lang.patch .
RUN patch -p1 < lang.patch
COPY ./translation/ru.json ./shared/i18n/locales/ru_RU/translation.json
ARG CDN_URL
RUN yarn build && rm -rf node_modules
FROM node:22-slim AS release
RUN apt-get update && \
apt-get install -y curl && \
rm -rf /var/lib/apt/lists/*
ARG DATA_PATH=/var/lib/outline/data
ARG USER=nodejs
ARG APP_PATH
WORKDIR $APP_PATH
RUN addgroup --gid 1001 ${USER} && \
adduser --uid 1001 --ingroup ${USER} ${USER} && \
mkdir -p ${DATA_PATH} && \
chown -R ${USER}:${USER} ${DATA_PATH}/..
COPY --chown=${USER} --from=deps $APP_PATH/node_modules ./node_modules
COPY --chown=${USER} --from=build $APP_PATH/build ./build
COPY --chown=${USER} --from=build $APP_PATH/server ./server
COPY --chown=${USER} --from=build $APP_PATH/public ./public
COPY --chown=${USER} --from=build $APP_PATH/.sequelizerc .
COPY --chown=${USER} --from=build $APP_PATH/package.json .
ENV NODE_ENV=production
ENV PORT=3000
USER ${USER}
EXPOSE ${PORT}
VOLUME ${DATA_PATH}
HEALTHCHECK --interval=1m CMD curl -fs localhost:${PORT}/_health | grep -q OK || exit 1
CMD ["yarn", "start"]