Skip to content

Commit

Permalink
Add Dockerfile for ppdb-replication
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyMcCormick committed Oct 1, 2024
1 parent bdad175 commit 9405392
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions docker/Dockerfile.replication
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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

# Create an application group and user so we don't run as root.
# RUN groupadd -g 1000 appgroup && \
# useradd -ms /bin/bash -u 1000 -g 1000 appuser && \
# chown -R appuser:appgroup /app
# USER appuser

# ENTRYPOINT ["/app/entrypoint-replication.sh"]
CMD ["/app/entrypoint-replication.sh"]

0 comments on commit 9405392

Please sign in to comment.