mirror of
https://github.com/flameshikari/outline-ru.git
synced 2026-06-13 04:05:10 +03:00
fix Dockerfile order
Build / Build [amd64] (push) Has been cancelled
Build / Build [arm64] (push) Has been cancelled
Build / Publish (push) Has been cancelled
Build / Build [amd64] (push) Has been cancelled
Build / Build [arm64] (push) Has been cancelled
Build / Publish (push) Has been cancelled
This commit is contained in:
+16
-8
@@ -1,21 +1,25 @@
|
|||||||
ARG APP_PATH=/opt/outline
|
ARG APP_PATH=/opt/outline
|
||||||
ARG SRC_PATH=./outline
|
ARG SRC_PATH=./outline
|
||||||
|
|
||||||
FROM node:20 AS base
|
|
||||||
|
|
||||||
|
FROM node:20 AS deps
|
||||||
ARG APP_PATH
|
ARG APP_PATH
|
||||||
ARG SRC_PATH
|
ARG SRC_PATH
|
||||||
WORKDIR $APP_PATH
|
WORKDIR $APP_PATH
|
||||||
COPY ${SRC_PATH}/package.json ${SRC_PATH}/yarn.lock ./
|
COPY ${SRC_PATH}/package.json ${SRC_PATH}/yarn.lock ./
|
||||||
|
|
||||||
FROM base AS deps
|
|
||||||
RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \
|
RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \
|
||||||
yarn cache clean
|
yarn cache clean
|
||||||
|
|
||||||
FROM base AS build
|
FROM node:20 AS build
|
||||||
|
ARG APP_PATH
|
||||||
|
ARG SRC_PATH
|
||||||
|
WORKDIR $APP_PATH
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y patch cmake && \
|
apt-get install -y patch cmake && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
COPY ${SRC_PATH}/patches ./patches
|
COPY ${SRC_PATH}/patches ./patches
|
||||||
|
COPY ${SRC_PATH}/package.json ${SRC_PATH}/yarn.lock ./
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=24000"
|
ENV NODE_OPTIONS="--max-old-space-size=24000"
|
||||||
RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \
|
RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \
|
||||||
yarn cache clean
|
yarn cache clean
|
||||||
@@ -24,9 +28,12 @@ COPY ./tools/language.patch .
|
|||||||
RUN patch -p1 < language.patch
|
RUN patch -p1 < language.patch
|
||||||
COPY ./tools/translation.json ./shared/i18n/locales/ru_RU/translation.json
|
COPY ./tools/translation.json ./shared/i18n/locales/ru_RU/translation.json
|
||||||
ARG CDN_URL
|
ARG CDN_URL
|
||||||
RUN yarn build
|
RUN yarn build && rm -rf node_modules
|
||||||
|
|
||||||
FROM base AS release
|
FROM node:20-slim AS release
|
||||||
|
ARG APP_PATH
|
||||||
|
ARG SRC_PATH
|
||||||
|
WORKDIR $APP_PATH
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y curl && \
|
apt-get install -y curl && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
@@ -36,11 +43,12 @@ RUN useradd -U ${USER} && \
|
|||||||
mkdir -p ${DATA_PATH} && \
|
mkdir -p ${DATA_PATH} && \
|
||||||
chown -R ${USER}:${USER} ${APP_PATH} ${DATA_PATH}/.. && \
|
chown -R ${USER}:${USER} ${APP_PATH} ${DATA_PATH}/.. && \
|
||||||
chmod 1777 ${DATA_PATH}
|
chmod 1777 ${DATA_PATH}
|
||||||
COPY --chown=${USER} --from=deps $APP_PATH/node_modules ./node_modules
|
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/build ./build
|
||||||
COPY --chown=${USER} --from=build $APP_PATH/server ./server
|
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/public ./public
|
||||||
|
COPY --chown=${USER} --from=build $APP_PATH/.sequelizerc .
|
||||||
|
COPY --chown=${USER} --from=build $APP_PATH/package.json .
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
USER ${USER}
|
USER ${USER}
|
||||||
|
|||||||
Reference in New Issue
Block a user