-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
1 changed file
with
1 addition
and
76 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 |
---|---|---|
@@ -1,82 +1,7 @@ | ||
ARG BASE_IMAGE=debian:11.7-slim@sha256:924df86f8aad741a0134b2de7d8e70c5c6863f839caadef62609c1be1340daf5 | ||
FROM ${BASE_IMAGE} AS builder | ||
|
||
ENV REFRESHED_AT=2023-06-15 | ||
|
||
LABEL Name="senzing/stream-loader" \ | ||
Maintainer="support@senzing.com" \ | ||
Version="1.9.2" | ||
|
||
# Run as "root" for system installation. | ||
USER root | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y install \ | ||
python3 \ | ||
python3-dev \ | ||
python3-venv \ | ||
python3-pip \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# create and activate virtual environment | ||
RUN python3 -m venv /app/venv | ||
ENV PATH="/app/venv/bin:$PATH" | ||
|
||
# Install packages via PIP. | ||
COPY requirements.txt . | ||
RUN pip3 install --upgrade pip \ | ||
&& pip3 install -r requirements.txt \ | ||
&& rm /requirements.txt | ||
|
||
## | ||
# create the runtime image | ||
FROM ${BASE_IMAGE} AS runner | ||
|
||
# Define health check | ||
|
||
HEALTHCHECK CMD ["/app/healthcheck.sh"] | ||
|
||
# Run as "root" for system installation. | ||
|
||
USER root | ||
|
||
# Install packages via apt. | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y install \ | ||
librdkafka-dev \ | ||
libxml2 \ | ||
python3 \ | ||
python3-venv \ | ||
postgresql-client \ | ||
unixodbc \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy files from repository. | ||
COPY ./rootfs / | ||
COPY ./stream-loader.py /app/ | ||
|
||
# Copy python virtual environment from the builder image | ||
COPY --from=builder /app/venv /app/venv | ||
|
||
# Make non-root container. | ||
USER 1001 | ||
|
||
# make sure all messages always reach console | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# activate virtual environment | ||
ENV VIRTUAL_ENV=/app/venv | ||
ENV PATH="/app/venv/bin:$PATH" | ||
|
||
# Runtime execution. | ||
ENV SENZING_DOCKER_LAUNCHED=true | ||
ENV LD_LIBRARY_PATH=/opt/senzing/g2/lib:/opt/senzing/g2/lib/debian:/opt/IBM/db2/clidriver/lib | ||
ENV PATH=${PATH}:/opt/senzing/g2/python:/opt/IBM/db2/clidriver/adm:/opt/IBM/db2/clidriver/bin | ||
ENV PYTHONPATH=/opt/senzing/g2/python | ||
ENV SENZING_ETC_PATH=/etc/opt/senzing | ||
|
||
WORKDIR /app | ||
ENTRYPOINT ["/app/stream-loader.py"] | ||
CMD ls |