Updating Docker files for mono repo

This commit is contained in:
Chris Troutner
2026-08-26 12:05:01 -07:00
parent b58f360c89
commit 69c38d5a36
12 changed files with 114 additions and 79 deletions
@@ -1,18 +1,20 @@
# Create a Dockerized block indexer
#
# Build context: psf-memo monorepo root
# docker compose build block-indexer
#IMAGE BUILD COMMANDS
FROM ubuntu:24.04
MAINTAINER Chris Troutner <chris.troutner@gmail.com>
#Update the OS and install any OS packages needed.
RUN apt-get update
RUN apt-get install -y sudo git curl nano gnupg wget zip unzip python3
RUN apt-get update && apt-get install -y sudo curl nano gnupg wget zip unzip python3 \
&& rm -rf /var/lib/apt/lists/*
#Install Node and NPM
RUN curl -sL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh
RUN apt-get install -y nodejs build-essential
RUN curl -sL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh \
&& bash nodesource_setup.sh \
&& apt-get update && apt-get install -y nodejs build-essential \
&& rm -rf /var/lib/apt/lists/*
#Create the user 'safeuser' and add them to the sudo group.
RUN useradd -ms /bin/bash safeuser
@@ -30,17 +32,10 @@ RUN chown -R safeuser .npm-global
RUN echo "export PATH=~/.npm-global/bin:$PATH" >> /home/safeuser/.profile
RUN runuser -l safeuser -c "npm config set prefix '~/.npm-global'"
# Clone the psf-memo-indexer repository
WORKDIR /home/safeuser
RUN git clone https://github.com/Permissionless-Software-Foundation/psf-memo-indexer
# Switch to the desired branch. `master` is usually stable,
# and `stage` has the most up-to-date changes.
# Copy psf-memo-indexer from the monorepo
COPY psf-memo-indexer /home/safeuser/psf-memo-indexer
WORKDIR /home/safeuser/psf-memo-indexer
# For development: switch to unstable branch
#RUN git checkout <branch-name>
# Install dependencies
RUN npm install