-
Notifications
You must be signed in to change notification settings - Fork 0
/
heroku-Dockerfile
48 lines (36 loc) · 2.05 KB
/
heroku-Dockerfile
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
48
FROM python:3.9
ENV PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=off PIP_DISABLE_PIP_VERSION_CHECK=on
# Install GPG dependencies
RUN apt-get update \
&& apt-get install -y gnupg apt-transport-https gpg-agent curl ca-certificates
# Add Datadog repository and signing keys
ENV DATADOG_APT_KEYRING="/usr/share/keyrings/datadog-archive-keyring.gpg"
ENV DATADOG_APT_KEYS_URL="https://keys.datadoghq.com"
RUN sh -c "echo 'deb [signed-by=${DATADOG_APT_KEYRING}] https://apt.datadoghq.com/ stable 7' > /etc/apt/sources.list.d/datadog.list"
RUN touch ${DATADOG_APT_KEYRING}
RUN curl -o /tmp/DATADOG_APT_KEY_CURRENT.public "${DATADOG_APT_KEYS_URL}/DATADOG_APT_KEY_CURRENT.public" && \
gpg --ignore-time-conflict --no-default-keyring --keyring ${DATADOG_APT_KEYRING} --import /tmp/DATADOG_APT_KEY_CURRENT.public
RUN curl -o /tmp/DATADOG_APT_KEY_F14F620E.public "${DATADOG_APT_KEYS_URL}/DATADOG_APT_KEY_F14F620E.public" && \
gpg --ignore-time-conflict --no-default-keyring --keyring ${DATADOG_APT_KEYRING} --import /tmp/DATADOG_APT_KEY_F14F620E.public
RUN curl -o /tmp/DATADOG_APT_KEY_382E94DE.public "${DATADOG_APT_KEYS_URL}/DATADOG_APT_KEY_382E94DE.public" && \
gpg --ignore-time-conflict --no-default-keyring --keyring ${DATADOG_APT_KEYRING} --import /tmp/DATADOG_APT_KEY_382E94DE.public
# Install the Datadog Agent
RUN apt-get update && apt-get -y --force-yes install --reinstall datadog-agent
# Expose DogStatsD and trace-agent ports
EXPOSE 8125/udp 8126/tcp
# Copy your Datadog configuration
COPY heroku/datadog-config/ /etc/datadog-agent/
# install poetry
RUN pip install poetry
# copy project requirement files here to ensure they will be cached.
WORKDIR /code
COPY poetry.lock pyproject.toml /code/
# install runtime deps
RUN poetry config virtualenvs.create false
RUN poetry install --no-interaction --no-ansi
# We make sure we copy "src" directory and heroku-entrypoint.sh only. We do not want to copy unnecessary files like
# tests, docs, etc.
COPY ./src ./src/
COPY ./heroku-entrypoint.sh ./heroku-entrypoint.sh
RUN chmod +x ./heroku-entrypoint.sh
CMD ["./heroku-entrypoint.sh"]