Skip to content
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

Add possibility to define the timezone via the TZ env var in the docker containers #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ LOGSTASH_HOST=logstash
APMSERVER_HOST=apm-server
APMSERVER_PORT=8200

#----------- Credientals ------------------------#
#----------- Timezone ---------------------------#
# Set the timezone in all containers
TZ=Etc/UTC

#----------- Credentials ------------------------#
# Username & Password for Admin Elasticsearch cluster.
# This is used to set the password at setup, and used by others to connect to Elasticsearch at runtime.
# USERNAME cannot be changed! It is set here for parmeterization only.
# USERNAME cannot be changed! It is set here for parameterization only.
ELASTIC_USERNAME=elastic
ELASTIC_PASSWORD=changeme
AWS_ACCESS_KEY_ID=nottherealid
Expand All @@ -34,7 +38,7 @@ ELASTIC_CLUSTER_NAME=elastdocker-cluster
ELASTIC_INIT_MASTER_NODE=elastdocker-node-0
ELASTIC_NODE_NAME=elastdocker-node-0

# Hostnames of master eligble elasticsearch instances. (matches compose generated host name)
# Hostnames of master eligible elasticsearch instances. (matches compose generated host name)
ELASTIC_DISCOVERY_SEEDS=elasticsearch

#----------- For Multinode Cluster --------------#
Expand Down
7 changes: 7 additions & 0 deletions apm-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ ARG ELK_VERSION
# https://github.com/elastic/apm-server
FROM docker.elastic.co/apm/apm-server:${ELK_VERSION}
ARG ELK_VERSION

USER root
RUN apt-get -qq update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
USER apm-server
2 changes: 2 additions & 0 deletions docker-compose.nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
ELK_VERSION: ${ELK_VERSION}
restart: unless-stopped
environment:
TZ: ${TZ}
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTIC_CLUSTER_NAME: ${ELASTIC_CLUSTER_NAME}
Expand Down Expand Up @@ -51,6 +52,7 @@ services:
ELK_VERSION: ${ELK_VERSION}
restart: unless-stopped
environment:
TZ: ${TZ}
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTIC_CLUSTER_NAME: ${ELASTIC_CLUSTER_NAME}
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
- ./secrets:/secrets
- ./setup/:/setup/
environment:
TZ: ${TZ}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}

certs:
Expand All @@ -25,4 +26,6 @@ services:
user: "0"
volumes:
- ./secrets:/secrets
- ./setup/:/setup
- ./setup/:/setup
environment:
TZ: ${TZ}
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ services:
ELK_VERSION: ${ELK_VERSION}
restart: unless-stopped
environment:
TZ: ${TZ}
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTIC_CLUSTER_NAME: ${ELASTIC_CLUSTER_NAME}
Expand Down Expand Up @@ -91,6 +92,7 @@ services:
- source: elastic.ca
target: /certs/ca.crt
environment:
TZ: ${TZ}
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTICSEARCH_HOST_PORT: https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}
Expand All @@ -111,6 +113,7 @@ services:
volumes:
- ./kibana/config/:/usr/share/kibana/config:ro
environment:
TZ: ${TZ}
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTICSEARCH_HOST_PORT: https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}
Expand Down Expand Up @@ -139,6 +142,7 @@ services:
volumes:
- ./apm-server/config/apm-server.yml:/usr/share/apm-server/apm-server.yml:ro
environment:
TZ: ${TZ}
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
ELASTICSEARCH_HOST_PORT: https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}
Expand Down
7 changes: 7 additions & 0 deletions elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ ARG ELK_VERSION
# https://github.com/elastic/elasticsearch-docker
FROM docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION}

USER root
RUN apt-get -qq update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
USER elasticsearch

# Add healthcheck
COPY scripts/docker-healthcheck .
HEALTHCHECK CMD sh ./docker-healthcheck
Expand Down
7 changes: 7 additions & 0 deletions kibana/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@ ARG ELK_VERSION
FROM docker.elastic.co/kibana/kibana:${ELK_VERSION}
ARG ELK_VERSION

USER root
RUN apt-get -qq update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
USER kibana

# Add your kibana plugins setup here
# Example: RUN kibana-plugin install <name|url>
7 changes: 7 additions & 0 deletions logstash/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ ARG ELK_VERSION
# https://github.com/elastic/logstash-docker
FROM docker.elastic.co/logstash/logstash:${ELK_VERSION}

USER root
RUN apt-get -qq update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
USER logstash

HEALTHCHECK --interval=240s --timeout=120s --retries=5 \
CMD curl -s -XGET 'http://127.0.0.1:9600'

Expand Down
Loading