Skip to content

Commit

Permalink
Add Dockerfile for running ppdb-replication
Browse files Browse the repository at this point in the history
This will run the ppdb-replication command, which is installed through
pip. The entrypoint script used to run the command will convert the
PPDB environment variables into the appropriate command line arguments.
  • Loading branch information
JeremyMcCormick committed Oct 1, 2024
1 parent b0f4945 commit bfea3c8
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docker/Dockerfile.replication
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM python:3.11.6-slim-bookworm

ENV DEBIAN_FRONTEND=noninteractive

# Update and install OS dependencies
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get -y install --no-install-recommends git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install required python build dependencies
RUN pip install --upgrade --no-cache-dir pip setuptools wheel uv

# Create the build directory
WORKDIR /build
COPY . /build

# Install requirements
RUN uv pip install --no-cache-dir --system cassandra-driver psycopg2-binary
RUN uv pip install --no-cache-dir --system -r requirements.txt

# Install the package
RUN uv pip install --no-cache-dir --system --no-deps .

# Setup the application scripts
WORKDIR /app

# Install sdm_schemas
RUN git clone https://github.com/lsst/sdm_schemas.git
ENV SDM_SCHEMAS_DIR=/app/sdm_schemas

# Copy the entrypoint script
COPY docker/scripts/entrypoint-replication.sh .
RUN chmod +x /app/entrypoint-replication.sh

# Remove the build directory
RUN rm -rf /build

# Run the wrapper script for the ppdb-replication command
CMD ["/app/entrypoint-replication.sh"]

0 comments on commit bfea3c8

Please sign in to comment.