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
fix: run database migrations on startup
aparker.io
3 months ago
3ca202bd
08a84363
2/2
cd.yaml
success
2m 24s
ci.yaml
success
27s
+17
-1
2 changed files
expand all
collapse all
unified
split
Dockerfile
scripts
start.sh
+3
-1
Dockerfile
···
26
26
COPY --from=build /app/package.json ./
27
27
COPY --from=build /app/drizzle ./drizzle
28
28
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
29
29
+
COPY scripts/start.sh /app/start.sh
30
30
+
COPY drizzle.content.config.ts drizzle.local.config.ts ./
29
31
30
32
# Create data directory (will be mounted as volume)
31
33
RUN mkdir -p /data
···
37
39
38
40
EXPOSE 3000
39
41
40
40
-
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
42
42
+
CMD ["/app/start.sh"]
+14
scripts/start.sh
···
1
1
+
#!/bin/bash
2
2
+
set -e
3
3
+
4
4
+
echo "[startup] Running database migrations..."
5
5
+
6
6
+
# Run content DB migrations
7
7
+
npx drizzle-kit migrate --config drizzle.content.config.ts
8
8
+
9
9
+
# Run local DB migrations
10
10
+
npx drizzle-kit migrate --config drizzle.local.config.ts
11
11
+
12
12
+
echo "[startup] Migrations complete, starting supervisord..."
13
13
+
14
14
+
exec supervisord -c /etc/supervisor/conf.d/supervisord.conf