ing
This commit is contained in:
parent
8c9b6497c0
commit
12cdd2436c
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
|||
FROM alpine:3.7
|
||||
|
||||
# grab su-exec for easy step-down from root
|
||||
RUN apk add --no-cache curl
|
||||
|
||||
COPY _docker/config/* /etc/overflow/config/
|
||||
COPY _docker/bin/* /usr/local/overflow/bin/
|
||||
COPY dist/consumer_metric /usr/local/overflow/bin/
|
||||
|
||||
RUN mkdir -p /var/overflow/logs; \
|
||||
chmod +x /usr/local/overflow/bin/docker-entrypoint.sh /usr/local/overflow/bin/consumer_metric;
|
||||
|
||||
ENV TINI_VERSION='0.17.0'
|
||||
|
||||
# Use tini as subreaper in Docker container to adopt zombie processes
|
||||
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static-amd64 -o /bin/tini && chmod +x /bin/tini
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["/bin/tini", "--"]
|
||||
CMD ["/usr/local/overflow/bin/docker-entrypoint.sh"]
|
4
_docker/bin/docker-entrypoint.sh
Normal file
4
_docker/bin/docker-entrypoint.sh
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
exec /usr/local/overflow/bin/consumer_metric -config-dir=/etc/overflow/config
|
34
_docker/config/config.json
Normal file
34
_docker/config/config.json
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"external": {
|
||||
"grpc": {
|
||||
"network": "tcp4",
|
||||
"address": "central:9111"
|
||||
},
|
||||
"kafka": {
|
||||
"consumers": {
|
||||
"metric": {
|
||||
"brokers": [
|
||||
"kafka1:9092"
|
||||
],
|
||||
"groupID": "overflow-metric-group-id",
|
||||
"topic": "overflow-metric-topic",
|
||||
"minBytes": 10000,
|
||||
"maxBytes": 1000000
|
||||
}
|
||||
}
|
||||
},
|
||||
"influxDB": {
|
||||
"clientConfigs": {
|
||||
"metric": {
|
||||
"clientType": "http",
|
||||
"address": "influxdb:18086"
|
||||
}
|
||||
},
|
||||
"batchPointsConfigs": {
|
||||
"metric": {
|
||||
"database": "metric"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
8
build.sh
Executable file
8
build.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
rm ./dist
|
||||
CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o ./dist/consumer_metric
|
||||
|
||||
docker build -t docker.loafle.net/overflow/consumer_metric:1.0.0-SNAPSHOT .
|
||||
|
||||
docker push docker.loafle.net/overflow/consumer_metric:1.0.0-SNAPSHOT
|
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
version: "3"
|
||||
|
||||
services:
|
||||
consumer_metric:
|
||||
image: docker.loafle.net/overflow/consumer_metric:1.0.0-SNAPSHOT
|
||||
container_name: consumer_metric
|
||||
hostname: consumer_metric
|
||||
restart: always
|
||||
volumes:
|
||||
- /service/overflow/data/consumer_metric/opt/conf:/opt/conf
|
Loading…
Reference in New Issue
Block a user