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
chore: remove LiteFS and separate ingester configs
aparker.io
3 months ago
cf7e43fb
4e8d4112
+3
-102
5 changed files
expand all
collapse all
unified
split
Dockerfile.ingester
fly.ingester.toml
litefs.ingester.yml
litefs.yml
pnpm-lock.yaml
-43
Dockerfile.ingester
···
1
1
-
# Ingester Dockerfile
2
2
-
# Runs as standalone process on the LiteFS primary machine
3
3
-
4
4
-
FROM node:22-slim AS base
5
5
-
ENV PNPM_HOME="/pnpm"
6
6
-
ENV PATH="$PNPM_HOME:$PATH"
7
7
-
RUN corepack enable
8
8
-
9
9
-
WORKDIR /app
10
10
-
11
11
-
# Build stage
12
12
-
FROM base AS build
13
13
-
14
14
-
COPY package.json pnpm-lock.yaml .npmrc ./
15
15
-
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
16
16
-
17
17
-
COPY . .
18
18
-
# Build lexicons (needed for type validation)
19
19
-
RUN pnpm lex:build
20
20
-
21
21
-
# Production stage with LiteFS
22
22
-
FROM flyio/litefs:0.5 AS litefs
23
23
-
24
24
-
FROM base AS production
25
25
-
26
26
-
# Install LiteFS dependencies and copy binary
27
27
-
RUN apt-get update && apt-get install -y ca-certificates fuse3 sqlite3 && rm -rf /var/lib/apt/lists/*
28
28
-
COPY --from=litefs /usr/local/bin/litefs /usr/local/bin/litefs
29
29
-
30
30
-
COPY --from=build /app/node_modules ./node_modules
31
31
-
COPY --from=build /app/package.json ./
32
32
-
COPY --from=build /app/src ./src
33
33
-
COPY --from=build /app/drizzle ./drizzle
34
34
-
COPY litefs.ingester.yml /etc/litefs.yml
35
35
-
36
36
-
# Create directories (/var/lib/litefs is mounted volume, /litefs is FUSE mount)
37
37
-
RUN mkdir -p /var/lib/litefs /litefs
38
38
-
39
39
-
# Environment
40
40
-
ENV NODE_ENV=production
41
41
-
ENV CONTENT_DB_PATH=/litefs/content.db
42
42
-
43
43
-
ENTRYPOINT ["litefs", "mount"]
-22
fly.ingester.toml
···
1
1
-
# fly.toml app configuration file generated for papili-ingester on 2025-12-08T21:22:42-05:00
2
2
-
#
3
3
-
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4
4
-
#
5
5
-
6
6
-
app = 'papili-ingester'
7
7
-
primary_region = 'sjc'
8
8
-
9
9
-
[build]
10
10
-
dockerfile = 'Dockerfile.ingester'
11
11
-
12
12
-
[env]
13
13
-
CONTENT_DB_PATH = '/litefs/content.db'
14
14
-
15
15
-
# Volume for LiteFS data
16
16
-
[[mounts]]
17
17
-
source = 'ingester_data'
18
18
-
destination = '/var/lib/litefs'
19
19
-
20
20
-
[[vm]]
21
21
-
size = 'shared-cpu-1x'
22
22
-
memory = '256mb'
-19
litefs.ingester.yml
···
1
1
-
# LiteFS configuration for the ingester (primary)
2
2
-
# This machine is the only writer for the content database
3
3
-
4
4
-
fuse:
5
5
-
dir: '/litefs'
6
6
-
7
7
-
data:
8
8
-
dir: '/var/lib/litefs'
9
9
-
10
10
-
lease:
11
11
-
type: 'consul'
12
12
-
advertise-url: 'http://${HOSTNAME}.vm.${FLY_APP_NAME}.internal:20202'
13
13
-
candidate: true
14
14
-
consul:
15
15
-
url: '${FLY_CONSUL_URL}'
16
16
-
key: 'papili-one/primary'
17
17
-
18
18
-
exec:
19
19
-
- cmd: 'pnpm exec tsx src/ingester/main.ts'
-18
litefs.yml
···
1
1
-
# LiteFS configuration for the webapp (replica)
2
2
-
# This machine reads from the ingester primary
3
3
-
4
4
-
fuse:
5
5
-
dir: '/litefs'
6
6
-
7
7
-
data:
8
8
-
dir: '/var/lib/litefs'
9
9
-
10
10
-
lease:
11
11
-
type: 'consul'
12
12
-
advertise-url: 'http://${HOSTNAME}.vm.${FLY_APP_NAME}.internal:20202'
13
13
-
consul:
14
14
-
url: '${FLY_CONSUL_URL}'
15
15
-
key: 'papili-one/primary'
16
16
-
17
17
-
exec:
18
18
-
- cmd: 'node build'
+3
pnpm-lock.yaml
···
108
108
drizzle-orm:
109
109
specifier: ^0.44.7
110
110
version: 0.44.7(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)(@types/pg@8.15.6)
111
111
+
esbuild:
112
112
+
specifier: ^0.27.1
113
113
+
version: 0.27.1
111
114
eslint:
112
115
specifier: ^9.39.1
113
116
version: 9.39.1(jiti@2.6.1)