Skip to content

Commit

Permalink
docker, apache conf : use agent command, add agent.sample.yml and fix…
Browse files Browse the repository at this point in the history
… conf
  • Loading branch information
angad-k committed Feb 10, 2022
1 parent 832f88e commit 49ba3c8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WORKDIR /go/bin
COPY --from=builder /go/src/github.com/sdslabs/pinger/pinger .

# Copy over the agent.yml from Builder image
# COPY --from=builder /go/src/github.com/sdslabs/pinger/agent.yml .
COPY --from=builder /go/src/github.com/sdslabs/pinger/agent.yml .

# Final command to run pinger
CMD [ "./pinger", "version" ]
CMD [ "./pinger", "agent" ]
35 changes: 35 additions & 0 deletions agent.sample.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# agent.yml

# We need to tell Pinger to run the agent in standalone mode since the
# default behaviour is something else.
standalone: true

# Configuration for where metrics are stored.
metrics:
backend: timescale
host: timescale
port: 5432
username: postgres
password: password
db_name: pinger
ssl_mode: false # Let's just keep it off for now
page:
deploy: true
allowed_origins: ["*"] # For now allow every origin
name: My Status Page

# Interval after which metrics are logged into database.
interval: 5s

checks:
- id: ping-google # unique ID
name: Ping Google # human-readable name
interval: 5s # Ping every 5 seconds
timeout: 0.5s # Timeout if it takes longer than half a second
input:
type: HTTP # Protocol
output:
type: TIMEOUT # Condition for success/failure
target: # Target to hit/request
type: URL
value: http://www.google.com/
3 changes: 2 additions & 1 deletion deploy/pinger.apache.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Listen 80
<VirtualHost *:80>
ServerName pinger.staging.sdslabs.* pinger.sdslabs.*
ServerName pinger.staging.sdslabs.*
ServerAlias pinger.sdslabs.*
# Other directives here
<Location />
ProxyPass http://127.0.0.1:9010
Expand Down
3 changes: 1 addition & 2 deletions docs/src/contributing/build-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ $ make docker TAG="pinger:v1.2.3"
## Docker Compose

A `docker-compose.yml` is also provided to get pinger started more easier.
Just add an `agent.yml` according to your use case, replace
`CMD [ "./pinger", "version" ]` in the `Dockerfile` with `CMD [ "./pinger", "agent" ]`
Just add an `agent.yml` according to your use case (or Run `cp agent.sample.yml agent.yml`)
and then run `docker-compose up`.
This will get both the timescale db and pinger container up and running in no time!

Expand Down

0 comments on commit 49ba3c8

Please sign in to comment.