bluesky-pds-docker/Dockerfile

82 lines
2.9 KiB
Text
Raw Normal View History

2024-12-02 00:15:39 +00:00
################################################################################
# adapted from https://github.com/bluesky-social/pds/blob/v0.4.74/Dockerfile
################################################################################
FROM node:20.11-bookworm-slim AS pds-build
RUN npm install -g pnpm && apt-get update && apt-get -y install unzip
2024-12-02 00:15:39 +00:00
# Download and extract the PDS archive
WORKDIR /app
ADD https://github.com/bluesky-social/pds/archive/refs/tags/v0.4.74.zip .
RUN unzip v0.4.74.zip && \
mv pds-0.4.74/service/** . && \
mv pds-0.4.74/pdsadmin.sh .
RUN pnpm install --prod=true --frozen-lockfile
################################################################################
# adapted from https://github.com/bluesky-social/pds/blob/v0.4.74/Dockerfile
################################################################################
FROM node:20.11-bookworm-slim AS pds-runtime
RUN apt-get update && apt-get install -y \
2024-12-02 00:15:39 +00:00
dumb-init \
ca-certificates \
curl \
gnupg \
jq \
lsb-release \
openssl \
sqlite3 \
bsdextrautils \
2024-12-02 00:15:39 +00:00
xxd
# bsdextrautils for `column` command in the accounts script
2024-12-02 00:15:39 +00:00
WORKDIR /app
COPY --from=pds-build /app /app
EXPOSE 3000
ENV PDS_PORT=3000
ENV NODE_ENV=production
# potential perf issues w/ io_uring on this version of node
ENV UV_USE_IO_URING=0
2024-12-03 01:42:16 +00:00
LABEL org.opencontainers.image.source="https://github.com/bluesky-social/pds"
2024-12-02 00:15:39 +00:00
LABEL org.opencontainers.image.description="AT Protocol PDS"
2024-12-03 01:42:16 +00:00
LABEL org.opencontainers.image.licenses="MIT"
2024-12-02 00:15:39 +00:00
################################################################################
# adapted from https://github.com/bluesky-social/pds/blob/v0.4.74/installer.sh
################################################################################
FROM pds-runtime
ENV LOG_ENABLED="true"
ENV PDS_BLOB_UPLOAD_LIMIT="52428800"
ENV PDS_DATADIR="/pds"
ENV PDS_DATA_DIRECTORY="/pds"
ENV PDS_BLOBSTORE_DISK_LOCATION="${PDS_DATADIR}/blocks"
ENV PDS_DID_PLC_URL="https://plc.directory"
ENV PDS_BSKY_APP_VIEW_URL="https://api.bsky.app"
ENV PDS_BSKY_APP_VIEW_DID="did:web:api.bsky.app"
ENV PDS_REPORT_SERVICE_URL="https://mod.bsky.app"
ENV PDS_REPORT_SERVICE_DID="did:plc:ar7c4by46qjdydhdevvrndac"
ENV PDS_CRAWLERS="https://bsky.network"
RUN mv pdsadmin.sh /usr/local/bin/pdsadmin && \
chmod +x /usr/local/bin/pdsadmin && \
mkdir --mode=700 --parent ${PDS_DATADIR} && \
rm -rf pds-0.4.74 v0.4.74.zip && \
2024-12-02 00:15:39 +00:00
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["dumb-init", "--"]
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
CMD ["/entrypoint.sh"]
2024-12-03 01:42:16 +00:00
LABEL org.opencontainers.image.source="https://forgejo.gravityfargo.dev/gravityfargo/bluesky-pds-docker"
LABEL org.opencontainers.image.url="https://github.com/bluesky-social/pds"
LABEL org.opencontainers.image.description="A self contained PDS instance without caddy."
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.authors="Nathan Price <nathan@gravityfargo.dev>"