mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
fix: Docker build with Yarn 4 (#11031)
* Add missing corepack * Serialize plugin gen to protect memory * fix: Missing Yarn4 config * Prune dev deps
This commit is contained in:
@@ -15,3 +15,4 @@ crowdin.yml
|
|||||||
build
|
build
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
node_modules
|
node_modules
|
||||||
|
.yarn
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ RUN apt-get update \
|
|||||||
&& apt-get install -y wget \
|
&& apt-get install -y wget \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN corepack enable
|
||||||
|
|
||||||
ENV FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
|
ENV FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
|
||||||
RUN mkdir -p "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
|
RUN mkdir -p "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
|
||||||
chown -R nodejs:nodejs "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
|
chown -R nodejs:nodejs "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
|
||||||
|
|||||||
+2
-4
@@ -3,7 +3,7 @@ FROM node:22.21.0 AS deps
|
|||||||
|
|
||||||
ARG APP_PATH
|
ARG APP_PATH
|
||||||
WORKDIR $APP_PATH
|
WORKDIR $APP_PATH
|
||||||
COPY ./package.json ./yarn.lock ./
|
COPY ./package.json ./yarn.lock ./.yarnrc.yml ./
|
||||||
COPY ./patches ./patches
|
COPY ./patches ./patches
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y cmake
|
RUN apt-get update && apt-get install -y cmake
|
||||||
@@ -17,9 +17,7 @@ COPY . .
|
|||||||
ARG CDN_URL
|
ARG CDN_URL
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
RUN rm -rf node_modules
|
RUN yarn workspaces focus --production && \
|
||||||
|
|
||||||
RUN yarn install --immutable --network-timeout 1000000 && \
|
|
||||||
yarn cache clean
|
yarn cache clean
|
||||||
|
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
|
|||||||
@@ -46,25 +46,26 @@ async function build() {
|
|||||||
execAsync(
|
execAsync(
|
||||||
"yarn babel --extensions .ts,.tsx --quiet -d ./build/shared ./shared"
|
"yarn babel --extensions .ts,.tsx --quiet -d ./build/shared ./shared"
|
||||||
),
|
),
|
||||||
...d.map(async (plugin) => {
|
|
||||||
const hasServer = existsSync(`./plugins/${plugin}/server`);
|
|
||||||
|
|
||||||
if (hasServer) {
|
|
||||||
await execAsync(
|
|
||||||
`yarn babel --extensions .ts,.tsx --quiet -d "./build/plugins/${plugin}/server" "./plugins/${plugin}/server"`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasShared = existsSync(`./plugins/${plugin}/shared`);
|
|
||||||
|
|
||||||
if (hasShared) {
|
|
||||||
await execAsync(
|
|
||||||
`yarn babel --extensions .ts,.tsx --quiet -d "./build/plugins/${plugin}/shared" "./plugins/${plugin}/shared"`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
for (const plugin of d) {
|
||||||
|
const hasServer = existsSync(`./plugins/${plugin}/server`);
|
||||||
|
|
||||||
|
if (hasServer) {
|
||||||
|
await execAsync(
|
||||||
|
`yarn babel --extensions .ts,.tsx --quiet -d "./build/plugins/${plugin}/server" "./plugins/${plugin}/server"`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const hasShared = existsSync(`./plugins/${plugin}/shared`);
|
||||||
|
|
||||||
|
if (hasShared) {
|
||||||
|
await execAsync(
|
||||||
|
`yarn babel --extensions .ts,.tsx --quiet -d "./build/plugins/${plugin}/shared" "./plugins/${plugin}/shared"`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Copy static files
|
// Copy static files
|
||||||
console.log("Copying static files…");
|
console.log("Copying static files…");
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
|||||||
Reference in New Issue
Block a user