File size: 1,192 Bytes
c081016
04069d4
ada4bc3
 
edb1977
5f0db80
 
 
85e5d0a
5f0db80
 
 
 
 
 
 
 
 
 
 
c081016
5f0db80
edb1977
706d707
0746643
 
c081016
0746643
edb1977
706d707
5f0db80
 
ada4bc3
 
 
 
 
 
70d57ef
 
5f0db80
8f2a338
 
ada4bc3
 
04069d4
 
ada4bc3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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"]