···11+# Config for my PI/PDS
22+33+`/pds/data` is ignored by git and is where pds data is stored
44+55+`/pds/service` is a clone of <https://github.com/bluesky-social/pds/tree/main/service> with some slight changes (`/.well-known/atproto-did/:handle` route)
66+77+`/tangled-on-commit.service` depends on <https://tangled.sh/@vielle.dev/tangled-on-commit> being installed
+25
commit.sh
···11+#!/usr/bin/env bash
22+33+echo
44+echo
55+echo "Got new commit: $(date)"
66+echo "---"
77+echo
88+99+# saves current state of fs
1010+git stash
1111+1212+# pull latest version
1313+git pull
1414+git submodule update
1515+1616+# restart/rebuild all containers
1717+docker compose build --no-cache
1818+docker compose up -d --force-recreate
1919+2020+# clear out dockerfiles to stop my drive exploding
2121+docker system prune -af
2222+2323+# return prev state of fs
2424+git stash pop
2525+exit 0
+29
compose.yml
···11+services:
22+ pds:
33+ build: ./pds
44+ # removed network_mode: host since it should still work without it
55+ # and instead bound port 3000 of container to 8000 of host
66+ ports:
77+ - 8000:3000
88+ restart: unless-stopped
99+ volumes:
1010+ - type: bind
1111+ # source is relative
1212+ source: ./pds/data
1313+ target: /pds
1414+ # env is relative
1515+ env_file:
1616+ - ./pds/data/pds.env
1717+1818+ watchtower:
1919+ container_name: watchtower
2020+ image: containrrr/watchtower:latest
2121+ network_mode: host
2222+ volumes:
2323+ - type: bind
2424+ source: /var/run/docker.sock
2525+ target: /var/run/docker.sock
2626+ restart: unless-stopped
2727+ environment:
2828+ WATCHTOWER_CLEANUP: true
2929+ WATCHTOWER_SCHEDULE: "@midnight"
+29
pds/Dockerfile
···11+FROM node:20.11-alpine3.18 as build
22+33+RUN corepack enable
44+55+# Move files into the image and install
66+WORKDIR /app
77+COPY ./service ./
88+RUN corepack prepare --activate
99+RUN pnpm install --production --frozen-lockfile > /dev/null
1010+1111+# Uses assets from build stage to reduce build size
1212+FROM node:20.11-alpine3.18
1313+1414+RUN apk add --update dumb-init
1515+1616+# Avoid zombie processes, handle signal forwarding
1717+ENTRYPOINT ["dumb-init", "--"]
1818+1919+WORKDIR /app
2020+COPY --from=build /app /app
2121+2222+EXPOSE 3000
2323+ENV PDS_PORT=3000
2424+ENV NODE_ENV=production
2525+# potential perf issues w/ io_uring on this version of node
2626+ENV UV_USE_IO_URING=0
2727+2828+CMD ["node", "--enable-source-maps", "index.js"]
2929+