Skip to content

Commit 20ac24a

Browse files
committed
Add commit hash as DD_VERSION in Dockerfile
Support version tracking in apm
1 parent 2660100 commit 20ac24a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
FROM python:3.7-slim-buster
22
MAINTAINER Devin Matte <[email protected]>
33

4+
ENV DD_LOGS_INJECTION=true
5+
46
RUN apt-get -yq update && \
5-
apt-get -yq --no-install-recommends install gcc curl libsasl2-dev libldap2-dev libssl-dev gnupg2 && \
7+
apt-get -yq --no-install-recommends install gcc curl libsasl2-dev libldap2-dev libssl-dev gnupg2 git && \
68
apt-get -yq clean all
79

810
RUN mkdir /opt/packet
@@ -30,4 +32,7 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
3032

3133
RUN ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
3234

33-
CMD ["ddtrace-run", "gunicorn", "packet:app", "--bind=0.0.0.0:8080", "--access-logfile=-", "--timeout=600"]
35+
# Set version for apm
36+
RUN echo "export DD_VERSION=$(git rev-parse --short HEAD)" >> ~/.bashrc
37+
38+
CMD ["/bin/bash", "-c", "source ~/.bashrc && ddtrace-run gunicorn packet:app --bind=0.0.0.0:8080 --access-logfile=- --timeout=600"]

0 commit comments

Comments
 (0)