enclosed / Dockerfile
eienmojiki's picture
Update Dockerfile
9f3ae3e verified
raw
history blame
1.19 kB
FROM node:20-slim AS builder
USER root
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN git clone https://github.com/CorentinTh/enclosed
WORKDIR /app/enclosed
RUN npm install -g pnpm --ignore-scripts && \
pnpm install --frozen-lockfile --ignore-scripts
RUN pnpm --filter @enclosed/crypto run build && \
pnpm --filter @enclosed/lib run build && \
pnpm --filter @enclosed/app-client run build && \
pnpm --filter @enclosed/app-server run build:node
FROM node:20-slim
RUN apt-get update && apt-get install -y \
git \
git-lfs \
bash \
curl \
wget \
procps && rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN chown -R 1000 /app
COPY --chown=1000 sync-notes.js ./
RUN npm install -g pm2 && \
npm install node-cron
COPY --from=builder /app/enclosed/packages/app-client/dist ./public
COPY --from=builder /app/enclosed/packages/app-server/dist-node/index.cjs ./index.cjs
RUN git clone https://kogakisaki:[email protected]/kogakisaki/enclosed-db ./.data
USER 1000
EXPOSE 8787
CMD ["/bin/sh", "-c", "cd .data; git pull; cd ..; pm2 start sync-notes.js; node index.cjs"]