-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.coincidence_system
More file actions
47 lines (37 loc) · 1.58 KB
/
Dockerfile.coincidence_system
File metadata and controls
47 lines (37 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM python:3.11-bullseye
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends gnupg apt-transport-https ca-certificates && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 112695A0E562B32A && \
sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list && \
apt-get update --allow-releaseinfo-change && \
apt-get install -y --no-install-recommends git build-essential libpq-dev && \
rm -rf /var/lib/apt/lists/*
# Accept build arguments
ARG HOP_USERNAME
ARG HOP_PASSWORD
# Set environment variables
ENV HOP_USERNAME=${HOP_USERNAME}
ENV HOP_PASSWORD=${HOP_PASSWORD}
# Clone the repository
ARG REPO_URL
ARG BRANCH
RUN git clone --branch ${BRANCH} ${REPO_URL} .
RUN sed -i 's/^FIREDRILL_OBSERVATION_TOPIC=.*/FIREDRILL_OBSERVATION_TOPIC=kafka:\/\/$\{HOP_BROKER\}\/snews\.experiments-github/' /app/snews_cs/etc/test-config.env
RUN sed -i 's/^FIREDRILL_ALERT_TOPIC=.*/FIREDRILL_ALERT_TOPIC=kafka:\/\/$\{HOP_BROKER\}\/snews\.alert-github/' /app/snews_cs/etc/test-config.env
# Copy credentials into the container
COPY generate_firedrill_creds.sh /app/generate_firedrill_creds.sh
RUN chmod +x /app/generate_firedrill_creds.sh
RUN /app/generate_firedrill_creds.sh
# Install Poetry
RUN pip install --no-cache-dir poetry
# Install dependencies using Poetry
RUN poetry lock
RUN poetry install
#
## Add hop credentials
RUN poetry run hop auth add hop_creds.csv
## Command to run the coincidence system
CMD ["poetry", "run", "snews_cs", "run-coincidence", "--firedrill"]