├── .github └── ISSUE_TEMPLATE │ ├── bug.yaml │ ├── documentation.yaml │ └── feature.yaml ├── .gitignore ├── .travis.yml ├── Dockerfile ├── LICENSE ├── README.md ├── docker-compose.yml ├── entrypoint.sh ├── influxdb.conf └── init-influxdb.sh /.github/ISSUE_TEMPLATE/bug.yaml: -------------------------------------------------------------------------------- 1 | name: "🐛 Bug Report" 2 | description: "Submit a bug report to help us improve" 3 | title: "🐛 Bug Report: " 4 | labels: [bug] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out our bug report form 🙏 10 | - type: textarea 11 | id: steps-to-reproduce 12 | validations: 13 | required: true 14 | attributes: 15 | label: "👟 Reproduction steps" 16 | description: "How do you trigger this bug? Please walk us through it step by step." 17 | placeholder: "When I ..." 18 | - type: textarea 19 | id: expected-behavior 20 | validations: 21 | required: true 22 | attributes: 23 | label: "👍 Expected behavior" 24 | description: "What did you think would happen?" 25 | placeholder: "It should ..." 26 | - type: textarea 27 | id: actual-behavior 28 | validations: 29 | required: true 30 | attributes: 31 | label: "👎 Actual Behavior" 32 | description: "What did actually happen? Add screenshots, if applicable." 33 | placeholder: "It actually ..." 34 | - type: dropdown 35 | id: appwrite-version 36 | attributes: 37 | label: "🎲 Appwrite version" 38 | description: "What version of Appwrite are you running?" 39 | options: 40 | - Version 0.10.x 41 | - Version 0.9.x 42 | - Version 0.8.x 43 | - Version 0.7.x 44 | - Version 0.6.x 45 | - Different version (specify in environment) 46 | validations: 47 | required: true 48 | - type: dropdown 49 | id: operating-system 50 | attributes: 51 | label: "💻 Operating system" 52 | description: "What OS is your server / device running on?" 53 | options: 54 | - Linux 55 | - MacOS 56 | - Windows 57 | - Something else 58 | validations: 59 | required: true 60 | - type: textarea 61 | id: enviromnemt 62 | validations: 63 | required: false 64 | attributes: 65 | label: "🧱 Your Environment" 66 | description: "Is your environment customized in any way?" 67 | placeholder: "I use Cloudflare for ..." 68 | - type: checkboxes 69 | id: no-duplicate-issues 70 | attributes: 71 | label: "👀 Have you spent some time to check if this issue has been raised before?" 72 | description: "Have you Googled for a similar issue or checked our older issues for a similar bug?" 73 | options: 74 | - label: "I checked and didn't find similar issue" 75 | required: true 76 | - type: checkboxes 77 | id: read-code-of-conduct 78 | attributes: 79 | label: "🏢 Have you read the Code of Conduct?" 80 | options: 81 | - label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)" 82 | required: true 83 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.yaml: -------------------------------------------------------------------------------- 1 | name: "📚 Documentation" 2 | description: "Report an issue related to documentation" 3 | title: "📚 Documentation: " 4 | labels: [documentation] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out our bug report form 🙏 10 | - type: textarea 11 | id: issue-description 12 | validations: 13 | required: true 14 | attributes: 15 | label: "💭 Description" 16 | description: "A clear and concise description of what the issue is." 17 | placeholder: "Documentation should not ..." 18 | - type: checkboxes 19 | id: no-duplicate-issues 20 | attributes: 21 | label: "👀 Have you spent some time to check if this issue has been raised before?" 22 | description: "Have you Googled for a similar issue or checked our older issues for a similar bug?" 23 | options: 24 | - label: "I checked and didn't find similar issue" 25 | required: true 26 | - type: checkboxes 27 | id: read-code-of-conduct 28 | attributes: 29 | label: "🏢 Have you read the Code of Conduct?" 30 | options: 31 | - label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)" 32 | required: true 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.yaml: -------------------------------------------------------------------------------- 1 | name: 🚀 Feature" 2 | description: "Submit a proposal for a new feature" 3 | title: "🚀 Feature: " 4 | labels: [feature] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out our bug report form 🙏 10 | - type: textarea 11 | id: feature-description 12 | validations: 13 | required: true 14 | attributes: 15 | label: "🔖 Feature description" 16 | description: "A clear and concise description of what the feature is." 17 | placeholder: "You should add ..." 18 | - type: textarea 19 | id: pitch 20 | validations: 21 | required: true 22 | attributes: 23 | label: "🎤 Pitch" 24 | description: "Please explain why this feature should be implemented and how it would be used. Add examples, if applicable." 25 | placeholder: "In my use-case, ..." 26 | - type: checkboxes 27 | id: no-duplicate-issues 28 | attributes: 29 | label: "👀 Have you spent some time to check if this issue has been raised before?" 30 | description: "Have you Googled for a similar issue or checked our older issues for a similar bug?" 31 | options: 32 | - label: "I checked and didn't find similar issue" 33 | required: true 34 | - type: checkboxes 35 | id: read-code-of-conduct 36 | attributes: 37 | label: "🏢 Have you read the Code of Conduct?" 38 | options: 39 | - label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)" 40 | required: true 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | .DS_Store -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | notifications: 3 | email: 4 | - team@appwrite.io 5 | 6 | language: minimal 7 | 8 | arch: 9 | - amd64 10 | - arm64 11 | 12 | os: linux 13 | dist: focal 14 | 15 | before_install: 16 | - curl -fsSL https://get.docker.com | sh 17 | - echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json 18 | - mkdir -p $HOME/.docker 19 | - echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json 20 | - sudo service docker start 21 | - > 22 | if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then 23 | echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin 24 | fi 25 | - docker --version 26 | 27 | install: 28 | - docker-compose up -d 29 | 30 | script: 31 | - sleep 10 32 | - docker ps -a 33 | - docker-compose logs influxdb 34 | - > 35 | if : >/dev/tcp/localhost/8086; then 36 | echo 'Connection available.' 37 | else 38 | echo 'Connection unavailable.' 39 | travis_terminate 1 40 | fi 41 | 42 | deploy: 43 | - provider: script 44 | edge: true 45 | script: docker run --rm --privileged linuxkit/binfmt:v0.8 && 46 | docker buildx create --use && 47 | docker buildx build --platform linux/386,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x -t appwrite/influxdb:$TRAVIS_TAG ./ --push 48 | on: 49 | tags: true 50 | condition: $TRAVIS_CPU_ARCH = amd64 -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.16 2 | 3 | LABEL maintainer="team@appwrite.io" 4 | 5 | RUN echo 'hosts: files dns' >> /etc/nsswitch.conf 6 | 7 | RUN apk add --no-cache \ 8 | tzdata=2022c-r0 \ 9 | bash=5.1.16-r2 \ 10 | ca-certificates=20220614-r0 && \ 11 | update-ca-certificates 12 | 13 | ENV INFLUXDB_VERSION 1.8.10 14 | 15 | RUN set -ex && \ 16 | apk add --no-cache --virtual .build-deps wget gnupg tar && \ 17 | for key in \ 18 | 05CE15085FC09D18E99EFB22684A14CF2582E0C5 ; \ 19 | do \ 20 | gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys "$key" ; \ 21 | done && \ 22 | [ "$(uname -m)" = x86_64 ] && suffix="-static_linux_amd64.tar.gz" || suffix="_linux_armhf.tar.gz"; \ 23 | wget --no-verbose https://dl.influxdata.com/influxdb/releases/influxdb-${INFLUXDB_VERSION}${suffix}.asc && \ 24 | wget --no-verbose https://dl.influxdata.com/influxdb/releases/influxdb-${INFLUXDB_VERSION}${suffix} && \ 25 | gpg --batch --verify influxdb-${INFLUXDB_VERSION}${suffix}.asc influxdb-${INFLUXDB_VERSION}${suffix} && \ 26 | mkdir -p /usr/src && \ 27 | tar -C /usr/src -xzf influxdb-${INFLUXDB_VERSION}${suffix} && \ 28 | cd /usr/src/influxdb-${INFLUXDB_VERSION}*; \ 29 | [ -d etc ] && cp -R etc/* /etc; \ 30 | [ -d usr ] && cp -R usr/* /usr; \ 31 | [ -d var ] && cp -R var/* /var; \ 32 | [ -f influxdb.conf ] && rm influxdb.conf && mv influx* /usr/bin; \ 33 | find /usr/bin -name "influx*" -exec chmod +x {} \; && \ 34 | gpgconf --kill all && \ 35 | rm -rf influxdb* /usr/src /root/.gnupg && \ 36 | apk del .build-deps 37 | 38 | COPY influxdb.conf /etc/influxdb/influxdb.conf 39 | 40 | EXPOSE 8086 41 | 42 | VOLUME /var/lib/influxdb 43 | 44 | COPY entrypoint.sh /entrypoint.sh 45 | COPY init-influxdb.sh /init-influxdb.sh 46 | 47 | RUN chmod +x /entrypoint.sh /init-influxdb.sh 48 | 49 | ENTRYPOINT ["/entrypoint.sh"] 50 | CMD ["influxd"] 51 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Appwrite 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker InfluxDB 2 | 3 | [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) 4 | [![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/influxdb?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/mariadb) 5 | [![Build Status](https://img.shields.io/travis/com/appwrite/docker-influxdb?style=flat-square)](https://travis-ci.com/appwrite/docker-influxdb) 6 | [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) 7 | [![Follow Appwrite on StackShare](https://img.shields.io/badge/follow%20on-stackshare-blue?style=flat-square)](https://stackshare.io/appwrite) 8 | 9 | 10 | InfluxDB Docker image pre-configured for [Appwrite server](https://appwrite.io) installation. This container is only extending the official InfluxDB docker image with Appwrite specific configuration settings, for a fresh installation of InfluxDB use only [docker official image](https://hub.docker.com/_/influxdb). 11 | 12 | ## Getting Started 13 | 14 | These instructions will cover usage information to help your run Appwrite's InfluxDB docker container. 15 | 16 | ### Prerequisities 17 | 18 | In order to run this container you'll need docker installed. 19 | 20 | * [Windows](https://docs.docker.com/windows/started) 21 | * [OS X](https://docs.docker.com/mac/started/) 22 | * [Linux](https://docs.docker.com/linux/started/) 23 | 24 | ### Usage 25 | 26 | ```shell 27 | docker run appwrite/influxdb 28 | ``` 29 | 30 | ### Environment Variables 31 | 32 | This container supports all environment variables supplied by the official InfluxDB Docker image. 33 | 34 | ### Build / Release 35 | 36 | ``` 37 | docker build --tag appwrite/influxdb:0.0.0 . 38 | docker push appwrite/influxdb:0.0.0 39 | ``` 40 | 41 | Multi-arch build (experimental using [buildx](https://github.com/docker/buildx)): 42 | 43 | ``` 44 | docker buildx create --use 45 | docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 --tag appwrite/influxdb:0.0.0 --push . 46 | ``` 47 | 48 | ## Find Us 49 | 50 | * [GitHub](https://github.com/appwrite) 51 | * [Discord](https://discord.gg/GSeTUeA) 52 | * [Twitter](https://twitter.com/appwrite_io) 53 | 54 | ## Copyright and license 55 | 56 | The MIT License [(MIT)](http://www.opensource.org/licenses/mit-license.php) 57 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3' 3 | 4 | services: 5 | influxdb: 6 | build: . 7 | restart: unless-stopped 8 | ports: 9 | - "8086:8086" 10 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [ "${1:0:1}" = '-' ]; then 5 | set -- influxd "$@" 6 | fi 7 | 8 | if [ "$1" = 'influxd' ]; then 9 | /init-influxdb.sh "${@:2}" 10 | fi 11 | 12 | exec "$@" 13 | -------------------------------------------------------------------------------- /influxdb.conf: -------------------------------------------------------------------------------- 1 | [meta] 2 | dir = "/var/lib/influxdb/meta" 3 | 4 | [data] 5 | dir = "/var/lib/influxdb/data" 6 | engine = "tsm1" 7 | wal-dir = "/var/lib/influxdb/wal" -------------------------------------------------------------------------------- /init-influxdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | AUTH_ENABLED="$INFLUXDB_HTTP_AUTH_ENABLED" 5 | 6 | if [ -z "$AUTH_ENABLED" ]; then 7 | AUTH_ENABLED="$(grep -iE '^\s*auth-enabled\s*=\s*true' /etc/influxdb/influxdb.conf | grep -io 'true' | cat)" 8 | else 9 | AUTH_ENABLED="$(echo "$INFLUXDB_HTTP_AUTH_ENABLED" | grep -io 'true' | cat)" 10 | fi 11 | 12 | INIT_USERS=$([ ! -z "$AUTH_ENABLED" ] && [ ! -z "$INFLUXDB_ADMIN_USER" ] && echo 1 || echo) 13 | 14 | # Check if an environment variable for where to put meta is set. 15 | # If so, then use that directory, otherwise use the default. 16 | if [ -z "$INFLUXDB_META_DIR" ]; then 17 | META_DIR="/var/lib/influxdb/meta" 18 | else 19 | META_DIR="$INFLUXDB_META_DIR" 20 | fi 21 | 22 | if ( [ ! -z "$INIT_USERS" ] || [ ! -z "$INFLUXDB_DB" ] || [ "$(ls -A /docker-entrypoint-initdb.d 2> /dev/null)" ] ) && [ ! "$(ls -d "$META_DIR" 2>/dev/null)" ]; then 23 | INIT_QUERY="" 24 | CREATE_DB_QUERY="CREATE DATABASE $INFLUXDB_DB" 25 | 26 | if [ ! -z "$INIT_USERS" ]; then 27 | if [ -z "$INFLUXDB_ADMIN_PASSWORD" ]; then 28 | INFLUXDB_ADMIN_PASSWORD="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32;echo;)" 29 | echo "INFLUXDB_ADMIN_PASSWORD:$INFLUXDB_ADMIN_PASSWORD" 30 | fi 31 | 32 | INIT_QUERY="CREATE USER \"$INFLUXDB_ADMIN_USER\" WITH PASSWORD '$INFLUXDB_ADMIN_PASSWORD' WITH ALL PRIVILEGES" 33 | elif [ ! -z "$INFLUXDB_DB" ]; then 34 | INIT_QUERY="$CREATE_DB_QUERY" 35 | else 36 | INIT_QUERY="SHOW DATABASES" 37 | fi 38 | 39 | INFLUXDB_INIT_PORT="8086" 40 | INFLUXDB_HTTP_BIND_ADDRESS=127.0.0.1:$INFLUXDB_INIT_PORT INFLUXDB_HTTP_HTTPS_ENABLED=false influxd "$@" & 41 | pid="$!" 42 | 43 | INFLUX_CMD="influx -host 127.0.0.1 -port $INFLUXDB_INIT_PORT -execute " 44 | 45 | for i in {30..0}; do 46 | if $INFLUX_CMD "$INIT_QUERY" &> /dev/null; then 47 | break 48 | fi 49 | echo 'influxdb init process in progress...' 50 | sleep 1 51 | done 52 | 53 | if [ "$i" = 0 ]; then 54 | echo >&2 'influxdb init process failed.' 55 | exit 1 56 | fi 57 | 58 | if [ ! -z "$INIT_USERS" ]; then 59 | INFLUX_CMD="influx -host 127.0.0.1 -port $INFLUXDB_INIT_PORT -username ${INFLUXDB_ADMIN_USER} -password ${INFLUXDB_ADMIN_PASSWORD} -execute " 60 | 61 | if [ ! -z "$INFLUXDB_DB" ]; then 62 | $INFLUX_CMD "$CREATE_DB_QUERY" 63 | fi 64 | 65 | if [ ! -z "$INFLUXDB_USER" ] && [ -z "$INFLUXDB_USER_PASSWORD" ]; then 66 | INFLUXDB_USER_PASSWORD="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32;echo;)" 67 | echo "INFLUXDB_USER_PASSWORD:$INFLUXDB_USER_PASSWORD" 68 | fi 69 | 70 | if [ ! -z "$INFLUXDB_USER" ]; then 71 | $INFLUX_CMD "CREATE USER \"$INFLUXDB_USER\" WITH PASSWORD '$INFLUXDB_USER_PASSWORD'" 72 | 73 | $INFLUX_CMD "REVOKE ALL PRIVILEGES FROM \"$INFLUXDB_USER\"" 74 | 75 | if [ ! -z "$INFLUXDB_DB" ]; then 76 | $INFLUX_CMD "GRANT ALL ON \"$INFLUXDB_DB\" TO \"$INFLUXDB_USER\"" 77 | fi 78 | fi 79 | 80 | if [ ! -z "$INFLUXDB_WRITE_USER" ] && [ -z "$INFLUXDB_WRITE_USER_PASSWORD" ]; then 81 | INFLUXDB_WRITE_USER_PASSWORD="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32;echo;)" 82 | echo "INFLUXDB_WRITE_USER_PASSWORD:$INFLUXDB_WRITE_USER_PASSWORD" 83 | fi 84 | 85 | if [ ! -z "$INFLUXDB_WRITE_USER" ]; then 86 | $INFLUX_CMD "CREATE USER \"$INFLUXDB_WRITE_USER\" WITH PASSWORD '$INFLUXDB_WRITE_USER_PASSWORD'" 87 | $INFLUX_CMD "REVOKE ALL PRIVILEGES FROM \"$INFLUXDB_WRITE_USER\"" 88 | 89 | if [ ! -z "$INFLUXDB_DB" ]; then 90 | $INFLUX_CMD "GRANT WRITE ON \"$INFLUXDB_DB\" TO \"$INFLUXDB_WRITE_USER\"" 91 | fi 92 | fi 93 | 94 | if [ ! -z "$INFLUXDB_READ_USER" ] && [ -z "$INFLUXDB_READ_USER_PASSWORD" ]; then 95 | INFLUXDB_READ_USER_PASSWORD="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32;echo;)" 96 | echo "INFLUXDB_READ_USER_PASSWORD:$INFLUXDB_READ_USER_PASSWORD" 97 | fi 98 | 99 | if [ ! -z "$INFLUXDB_READ_USER" ]; then 100 | $INFLUX_CMD "CREATE USER \"$INFLUXDB_READ_USER\" WITH PASSWORD '$INFLUXDB_READ_USER_PASSWORD'" 101 | $INFLUX_CMD "REVOKE ALL PRIVILEGES FROM \"$INFLUXDB_READ_USER\"" 102 | 103 | if [ ! -z "$INFLUXDB_DB" ]; then 104 | $INFLUX_CMD "GRANT READ ON \"$INFLUXDB_DB\" TO \"$INFLUXDB_READ_USER\"" 105 | fi 106 | fi 107 | fi 108 | 109 | for f in /docker-entrypoint-initdb.d/*; do 110 | case "$f" in 111 | *.sh) echo "$0: running $f"; . "$f" ;; 112 | *.iql) echo "$0: running $f"; $INFLUX_CMD "$(cat ""$f"")"; echo ;; 113 | *) echo "$0: ignoring $f" ;; 114 | esac 115 | echo 116 | done 117 | 118 | if ! kill -s TERM "$pid" || ! wait "$pid"; then 119 | echo >&2 'influxdb init process failed. (Could not stop influxdb)' 120 | exit 1 121 | fi 122 | fi 123 | --------------------------------------------------------------------------------