tangled
alpha
login
or
join now
aparker.io
/
papili.one
6
fork
atom
an atproto based link aggregator
6
fork
atom
overview
issues
pulls
pipelines
feat: replace LiteFS with supervisord multi-process setup
aparker.io
3 months ago
e8db2044
bc6300c2
+10
-13
1 changed file
expand all
collapse all
unified
split
Dockerfile
+10
-13
Dockerfile
···
13
13
14
14
COPY . .
15
15
RUN pnpm build
16
16
-
RUN CI=true pnpm prune --prod
17
16
18
18
-
# Production stage with LiteFS
19
19
-
FROM flyio/litefs:0.5 AS litefs
20
20
-
17
17
+
# Production stage
21
18
FROM base AS production
22
19
23
23
-
# Install LiteFS dependencies and copy binary
24
24
-
RUN apt-get update && apt-get install -y ca-certificates fuse3 sqlite3 && rm -rf /var/lib/apt/lists/*
25
25
-
COPY --from=litefs /usr/local/bin/litefs /usr/local/bin/litefs
20
20
+
# Install supervisor for multi-process management
21
21
+
RUN apt-get update && apt-get install -y supervisor && rm -rf /var/lib/apt/lists/*
26
22
23
23
+
# Copy built artifacts
27
24
COPY --from=build /app/build ./build
28
25
COPY --from=build /app/node_modules ./node_modules
29
26
COPY --from=build /app/package.json ./
30
27
COPY --from=build /app/drizzle ./drizzle
31
31
-
COPY litefs.yml /etc/litefs.yml
28
28
+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
32
29
33
33
-
# Create directories (/var/lib/litefs is mounted volume, /litefs is FUSE mount)
34
34
-
RUN mkdir -p /var/lib/litefs /litefs
30
30
+
# Create data directory (will be mounted as volume)
31
31
+
RUN mkdir -p /data
35
32
36
33
ENV NODE_ENV=production
37
34
ENV PORT=3000
38
38
-
# Content DB from LiteFS replica, local DB for auth/votes
39
39
-
ENV CONTENT_DB_PATH=/litefs/content.db
35
35
+
ENV CONTENT_DB_PATH=/data/content.db
40
36
ENV LOCAL_DB_PATH=/data/local.db
41
37
42
38
EXPOSE 3000
43
43
-
ENTRYPOINT ["litefs", "mount"]
39
39
+
40
40
+
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]