rebuild with update alpine and pnpm
This commit is contained in:
parent
48dcd2ba28
commit
a01e514efb
1 changed files with 30 additions and 21 deletions
51
Dockerfile
51
Dockerfile
|
|
@ -1,45 +1,54 @@
|
||||||
# Use Alpine as the base image
|
FROM node:25-alpine3.22 AS builder
|
||||||
FROM node:22-alpine3.21 AS builder
|
|
||||||
|
|
||||||
# Set metadata (optional but good practice)
|
|
||||||
LABEL maintainer="you@example.com"
|
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
# get all the deps
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
openjdk21-jre-headless \
|
openjdk21-jre-headless \
|
||||||
git \
|
git \
|
||||||
curl
|
curl
|
||||||
|
|
||||||
|
RUN npm install -g corepack --force && corepack enable
|
||||||
|
|
||||||
|
# Install Clojure
|
||||||
RUN curl -LO https://github.com/clojure/brew-install/releases/latest/download/linux-install.sh \
|
RUN curl -LO https://github.com/clojure/brew-install/releases/latest/download/linux-install.sh \
|
||||||
&& chmod +x linux-install.sh \
|
&& chmod +x linux-install.sh \
|
||||||
&& ./linux-install.sh
|
&& ./linux-install.sh
|
||||||
RUN git clone https://github.com/logseq/logseq.git --depth 1 \
|
|
||||||
&& cd logseq \
|
# Clone Logseq
|
||||||
&& yarn install
|
RUN git clone https://github.com/logseq/logseq.git --depth 1
|
||||||
|
|
||||||
|
WORKDIR /build/logseq
|
||||||
|
|
||||||
|
RUN pnpm install
|
||||||
|
|
||||||
|
# Build db-sync
|
||||||
WORKDIR /build/logseq/deps/db-sync
|
WORKDIR /build/logseq/deps/db-sync
|
||||||
#build db-sync
|
|
||||||
RUN yarn install \
|
RUN pnpm install \
|
||||||
&& yarn build:node-adapter \
|
&& pnpm build:node-adapter \
|
||||||
&& yarn install --production
|
&& pnpm install --production
|
||||||
#copy to /logseq-sync for final image
|
|
||||||
|
# Prepare runtime files
|
||||||
RUN mkdir -p /logseq-sync/worker \
|
RUN mkdir -p /logseq-sync/worker \
|
||||||
&& mv worker/dist /logseq-sync/worker \
|
&& mv worker/dist /logseq-sync/worker \
|
||||||
&& mv node_modules package.json yarn.lock start.sh /logseq-sync
|
&& mv node_modules package.json start.sh /logseq-sync
|
||||||
|
|
||||||
|
|
||||||
|
# ---------- Final stage ----------
|
||||||
|
FROM node:25-alpine3.22
|
||||||
|
|
||||||
|
WORKDIR /logseq-sync
|
||||||
|
|
||||||
#final image
|
|
||||||
FROM node:22-alpine3.21
|
|
||||||
COPY --from=builder /logseq-sync /logseq-sync
|
|
||||||
COPY start.sh /logseq-sync
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
curl
|
curl
|
||||||
|
|
||||||
WORKDIR /logseq-sync
|
COPY --from=builder /logseq-sync /logseq-sync
|
||||||
|
|
||||||
EXPOSE 8787
|
EXPOSE 8787
|
||||||
|
|
||||||
HEALTHCHECK CMD curl --fail http://localhost:8787/health || exit 1
|
HEALTHCHECK CMD curl --fail http://localhost:8787/health || exit 1
|
||||||
|
|
||||||
# Default command
|
|
||||||
CMD ["bash", "start.sh"]
|
CMD ["bash", "start.sh"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue