-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile for running ppdb-replication
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
1 parent
b0f4945
commit bfea3c8
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |