* add patch for version checking of outline-ru, not the original one

* optimize Dockerfile and add docker-compose.yml for deploying on localhost for testing purposes

* make ru_RU as the default language, combine patches into one

* update the workflow

* update docker* files

* rename the script

* testing translations

* add concurrency and fix regexps in the workflow

* disable action output

* bump outline to 0.83.0

* update Dockerfile

* update translations

* update readme

* update readme

* clear trailing whitespaces
This commit is contained in:
Evgeny
2025-04-12 00:46:50 +05:00
committed by GitHub
parent e098d1a7df
commit 032263ec5d
9 changed files with 533 additions and 312 deletions
+32 -32
View File
@@ -1,50 +1,50 @@
ARG APP_PATH=/opt/outline
ARG SRC_PATH=./outline
FROM node:20-slim AS base
FROM node:20 AS base
ARG APP_PATH
ARG SRC_PATH
WORKDIR $APP_PATH
COPY ${SRC_PATH}/package.json ${SRC_PATH}/yarn.lock ./
FROM base AS deps
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 && \
apt-get install -y patch cmake && \
rm -rf /var/lib/apt/lists/*
COPY ./outline/package.json ./outline/yarn.lock ./
COPY ./outline/patches ./patches
COPY ${SRC_PATH}/patches ./patches
ENV NODE_OPTIONS="--max-old-space-size=24000"
RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \
yarn cache clean
COPY ./outline .
COPY ${SRC_PATH} .
COPY ./tools/language.patch .
RUN patch -p1 < language.patch
COPY ./tools/translation.json ./shared/i18n/locales/ru_RU/translation.json
COPY ./tools/return_ru.patch .
RUN patch -p1 < return_ru.patch
ARG CDN_URL
RUN yarn build
RUN rm -rf node_modules
RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \
yarn cache clean
ENV PORT=3000
FROM base AS release
ENV NODE_ENV=production
COPY --from=build $APP_PATH/build ./build
COPY --from=build $APP_PATH/server ./server
COPY --from=build $APP_PATH/public ./public
COPY --from=build $APP_PATH/.sequelizerc ./.sequelizerc
COPY --from=build $APP_PATH/node_modules ./node_modules
COPY --from=build $APP_PATH/package.json ./package.json
RUN apt-get update && \
apt-get install -y wget && \
apt-get install -y curl && \
rm -rf /var/lib/apt/lists/*
RUN addgroup --gid 1001 nodejs && \
adduser --uid 1001 --ingroup nodejs nodejs && \
chown -R nodejs:nodejs $APP_PATH/build && \
mkdir -p /var/lib/outline && \
chown -R nodejs:nodejs /var/lib/outline
ENV FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
RUN mkdir -p "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
chown -R nodejs:nodejs "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
chmod 1777 "$FILE_STORAGE_LOCAL_ROOT_DIR"
VOLUME /var/lib/outline/data
USER nodejs
HEALTHCHECK --interval=1m CMD wget -qO- "http://localhost:${PORT:-3000}/_health" | grep -q "OK" || exit 1
EXPOSE 3000
ARG DATA_PATH=/var/lib/outline/data
ARG USER=nodejs
RUN useradd -U ${USER} && \
mkdir -p ${DATA_PATH} && \
chown -R ${USER}:${USER} ${APP_PATH} ${DATA_PATH}/.. && \
chmod 1777 ${DATA_PATH}
COPY --chown=${USER} --from=deps $APP_PATH/node_modules ./node_modules
COPY --chown=${USER} --from=build $APP_PATH/.sequelizerc .
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
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"]