diff --git a/docker/Dockerfile.replication b/docker/Dockerfile.replication new file mode 100644 index 0000000..d150e28 --- /dev/null +++ b/docker/Dockerfile.replication @@ -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"]