Skip to content

Commit

Permalink
debug env
Browse files Browse the repository at this point in the history
  • Loading branch information
eliaspcs committed Apr 12, 2023
1 parent 5abbd96 commit bc0191e
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
FROM python:3.9-slim-buster
# Set the environment variables
ENV MINUTES_INTERVAL=1
ENV INFLUXDB_BUCKET=my-bucket
ENV INFLUXDB_ORG=my-org
ENV INFLUXDB_TOKEN=my-token
ENV INFLUXDB_URL=http://localhost:8086
ENV PING_HOST=8.8.8.8
ENV PING_PACKETS=5
ENV PING_INTERVAL=0.5
ENV NOTIFY_ALWAYS=True

# Set the working directory
WORKDIR /app
Expand All @@ -15,19 +25,10 @@ RUN /usr/local/bin/python -m pip install --no-cache-dir -r requirements.txt
# Copy the script into the container
COPY telepinger.py .

# Set the environment variables
ENV MINUTES_INTERVAL=1
ENV INFLUXDB_BUCKET=my-bucket
ENV INFLUXDB_ORG=my-org
ENV INFLUXDB_TOKEN=my-token
ENV INFLUXDB_URL=http://localhost:8086
ENV PING_HOST=8.8.8.8
ENV PING_PACKETS=5
ENV PING_INTERVAL=0.5
ENV NOTIFY_ALWAYS=True

# set up the cron job
RUN echo "*/$MINUTES_INTERVAL * * * * /usr/local/bin/python /app/telepinger.py -c $PING_PACKETS -i $PING_INTERVAL $PING_HOST > /proc/1/fd/1 2>&1" | crontab -

RUN env

# Start cron in the foreground
CMD ["cron", "-f"]

0 comments on commit bc0191e

Please sign in to comment.