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