generated from fiufit-grupo-4/base-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
46 lines (35 loc) · 1.94 KB
/
Dockerfile.prod
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
# set node 14 as base image to Docker Engine!
# slim-buster is a lightweight version for server deployment
FROM node:14-buster-slim
# Install GPG dependencies
RUN apt-get update \
&& apt-get install -y gnupg apt-transport-https gpg-agent curl ca-certificates
COPY entrypoint-heroku.sh /
COPY datadog-config/ /etc/datadog-agent/
# 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
RUN chown -R dd-agent:dd-agent /etc/datadog-agent/auth_token
RUN chown -R dd-agent:dd-agent /var/log/datadog/
# Expose DogStatsD and trace-agent ports
EXPOSE 8125/udp 8126/tcp
# create working dir for image
WORKDIR /app
# copy dependancies from host to container
COPY package.json package-lock.json ./
# dependencies clean install
RUN npm install
# copy app from host to container
ADD app/ app/
# command to start and run FastAPI app container
CMD ["/entrypoint-heroku.sh"]