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

chore: add mysql-client and grafana in docker image #1530

Merged
merged 5 commits into from
May 12, 2024
Merged
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
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,18 @@ FROM ubuntu:20.04
RUN useradd -m -s /bin/bash horae

RUN apt update && \
apt install --yes curl gdb iotop cron vim less net-tools && \
apt install --yes curl gdb iotop cron vim less net-tools mysql-client apt-transport-https software-properties-common wget && \
apt clean

# install grafana
RUN mkdir -p /etc/apt/keyrings/ && \
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/grafana.gpg > /dev/null && \
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.list && \
apt update && \
apt install --yes grafana && \
apt clean
COPY ./docker/datasource.yml /usr/share/grafana/conf/provisioning/datasources

ENV RUST_BACKTRACE 1

COPY --from=build /horaedb/target/release/horaedb-server /usr/bin/horaedb-server
Expand Down
31 changes: 31 additions & 0 deletions docker/datasource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

apiVersion: 1

datasources:
dracoooooo marked this conversation as resolved.
Show resolved Hide resolved
- name: HoraeDB-mysql
type: mysql
access: proxy
url: localhost:3307
isDefault: true

- name: HoraeDB-influxdb
type: influxdb
access: proxy
url: http://localhost:5440/influxdb/v1/
isDefault: false
3 changes: 3 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ mkdir -p ${DATA_DIR}
chmod +777 -R ${DATA_DIR}
chown -R ${USER}.${USER} ${DATA_DIR}

# start grafana server
nohup /usr/share/grafana/bin/grafana server --homepath /usr/share/grafana/ &

exec /usr/bin/horaedb-server --config ${CONFIG_FILE}
Loading