-
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.
- Loading branch information
1 parent
bdad175
commit 9405392
Showing
1 changed file
with
47 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,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"] |