-
Notifications
You must be signed in to change notification settings - Fork 0
add Dockerfile and associated configuration #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .env |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FROM python:3.12-slim | ||
|
|
||
| ENV DATADOG_SITE=datadoghq.eu | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY src/ ./ | ||
| COPY requirements.txt ./ | ||
| COPY entrypoint.sh ./ | ||
|
|
||
| RUN pip install --no-cache-dir -r requirements.txt | ||
|
|
||
| ENTRYPOINT ["./entrypoint.sh"] | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||
| #!/bin/bash | ||||||||
| set -e | ||||||||
|
|
||||||||
| ./get_usage_report.py | ||||||||
|
||||||||
|
|
||||||||
| if [ "${SEND_TO_DATADOG}" = "true" ]; then | ||||||||
| for csv_file in /tmp/reports/*.csv; do | ||||||||
| # Check if the file actually exists (in case the glob didn't match anything) | ||||||||
| if [ -e "$csv_file" ]; then | ||||||||
|
||||||||
| if [ -e "$csv_file" ]; then | |
| if [ -e "$csv_file" ]; then | |
| chmod +x ./send_to_datadog.py |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| certifi==2025.7.14 | ||
| charset-normalizer==3.4.2 | ||
| datadog-api-client==2.40.0 | ||
| idna==3.10 | ||
| python-dateutil==2.9.0.post0 | ||
| requests==2.32.4 | ||
| six==1.17.0 | ||
| typing_extensions==4.14.1 | ||
| urllib3==2.5.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| #!/usr/bin/env python3 | ||
| # Import modules | ||
| import os | ||
| import requests | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entrypoint.sh script needs execute permissions to run properly. Add a RUN command after the COPY operations to set execute permissions:
RUN chmod +x entrypoint.sh get_usage_report.py send_to_datadog.py