Skip to content

Commit de36fd0

Browse files
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.
1 parent 33c7f7c commit de36fd0

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

docker/Dockerfile.replication

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM python:3.11.6-slim-bookworm
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# Update and install OS dependencies
6+
RUN apt-get -y update && \
7+
apt-get -y upgrade && \
8+
apt-get -y install --no-install-recommends git && \
9+
apt-get clean && \
10+
rm -rf /var/lib/apt/lists/*
11+
12+
# Install required python build dependencies
13+
RUN pip install --upgrade --no-cache-dir pip setuptools wheel uv
14+
15+
# Create the build directory
16+
WORKDIR /build
17+
COPY . /build
18+
19+
# Install requirements
20+
RUN uv pip install --no-cache-dir --system cassandra-driver psycopg2-binary
21+
RUN uv pip install --no-cache-dir --system -r requirements.txt
22+
23+
# Install the package
24+
RUN uv pip install --no-cache-dir --system --no-deps .
25+
26+
# Setup the application scripts
27+
WORKDIR /app
28+
29+
# Install sdm_schemas
30+
RUN git clone https://github.com/lsst/sdm_schemas.git
31+
ENV SDM_SCHEMAS_DIR=/app/sdm_schemas
32+
33+
# Copy the entrypoint script
34+
COPY docker/scripts/entrypoint-replication.sh .
35+
RUN chmod +x /app/entrypoint-replication.sh
36+
37+
# Remove the build directory
38+
RUN rm -rf /build
39+
40+
# Run the wrapper script for the ppdb-replication command
41+
CMD ["/app/entrypoint-replication.sh"]

0 commit comments

Comments
 (0)