add bsdextrautils, combined some run stages

This commit is contained in:
Nathan Price 2024-12-03 17:49:19 -05:00
parent 83f43f5466
commit 185155167b
Signed by: gravityfargo
SSH key fingerprint: SHA256:bjq+uA1U+9bFMd70q2wdNtwaYxGv84IBXalnYvZDKmg

View file

@ -2,10 +2,8 @@
# 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
RUN npm install -g pnpm && apt-get update && apt-get -y install unzip
# Download and extract the PDS archive
WORKDIR /app
@ -21,8 +19,7 @@ RUN pnpm install --prod=true --frozen-lockfile
################################################################################
FROM node:20.11-bookworm-slim AS pds-runtime
RUN apt-get update
RUN apt-get install -y \
RUN apt-get update && apt-get install -y \
dumb-init \
ca-certificates \
curl \
@ -31,7 +28,9 @@ RUN apt-get install -y \
lsb-release \
openssl \
sqlite3 \
bsdextrautils \
xxd
# bsdextrautils for `column` command in the accounts script
WORKDIR /app
COPY --from=pds-build /app /app
@ -65,9 +64,8 @@ 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 && \
mkdir --mode=700 --parent ${PDS_DATADIR} && \
rm -rf pds-0.4.74 v0.4.74.zip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*