bluesky-pds-docker/Dockerfile

80 lines
2.5 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
RUN apt-get update
RUN apt-get -y install unzip
# 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
RUN apt-get install -y \
dumb-init \
ca-certificates \
curl \
gnupg \
jq \
lsb-release \
openssl \
sqlite3 \
xxd
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
LABEL org.opencontainers.image.source=https://github.com/bluesky-social/pds
LABEL org.opencontainers.image.description="AT Protocol PDS"
LABEL org.opencontainers.image.licenses=MIT
################################################################################
# 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}
RUN rm -rf pds-0.4.74 v0.4.74.zip && \
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"]