├── Dockerfile ├── docker-compose.yml ├── LICENSE ├── .github └── ISSUE_TEMPLATE │ ├── documentation.yaml │ ├── feature.yaml │ └── bug.yaml ├── .travis.yml ├── README.md └── all.sql /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mariadb:10.6 2 | 3 | LABEL maintainer="team@appwrite.io" 4 | 5 | # Add appwrite schema and tables 6 | ADD ./all.sql /docker-entrypoint-initdb.d/all.sql 7 | 8 | RUN chown -R mysql:mysql /docker-entrypoint-initdb.d/ 9 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: '3' 3 | 4 | services: 5 | mariadb: 6 | build: . 7 | container_name: db-mariadb 8 | restart: unless-stopped 9 | networks: 10 | - db 11 | volumes: 12 | - db-mariadb:/var/lib/mysql:rw 13 | ports: 14 | - "3307:3306" 15 | environment: 16 | - MYSQL_ROOT_PASSWORD=rootsecretpassword 17 | - MYSQL_DATABASE=appwrite 18 | - MYSQL_USER=user 19 | - MYSQL_PASSWORD=password 20 | command: 'mysqld --innodb-flush-method=fsync' 21 | 22 | networks: 23 | db: 24 | 25 | volumes: 26 | db-mariadb: 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Appwrite.io 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /.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 make our documentation better 🙏 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 -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | notifications: 3 | email: 4 | - team@appwrite.io 5 | 6 | language: minimal 7 | 8 | arch: 9 | - amd64 10 | - arm64 11 | - ppc64le 12 | 13 | os: linux 14 | 15 | env: 16 | - CRYPTOGRAPHY_ALLOW_OPENSSL_102=true 17 | 18 | before_install: 19 | - curl -fsSL https://get.docker.com | sh 20 | - echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json 21 | - mkdir -p $HOME/.docker 22 | - echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json 23 | - sudo service docker start 24 | - > 25 | if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then 26 | echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin 27 | fi 28 | - docker --version 29 | 30 | install: 31 | - docker-compose up -d 32 | 33 | script: 34 | - sleep 10 35 | - docker ps -a 36 | - docker-compose logs mariadb 37 | - docker-compose exec -T mariadb ls /docker-entrypoint-initdb.d 38 | - docker-compose exec -T mariadb cat /docker-entrypoint-initdb.d/all.sql 39 | - docker-compose exec -T mariadb mysqldump --user=root --password=rootsecretpassword appwrite 40 | 41 | deploy: 42 | - provider: script 43 | edge: true 44 | script: docker run --rm --privileged linuxkit/binfmt:v0.8 && 45 | docker buildx create --use && 46 | docker buildx build --platform linux/amd64,linux/arm64/v8,linux/ppc64le -t appwrite/mariadb:$TRAVIS_TAG ./ --push 47 | on: 48 | tags: true 49 | condition: "$TRAVIS_CPU_ARCH = amd64" 50 | -------------------------------------------------------------------------------- /.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 feature request 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 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker MariaDB 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/mariadb?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/mariadb) 5 | [![Build Status](https://img.shields.io/travis/com/appwrite/docker-mariadb?style=flat-square)](https://travis-ci.com/appwrite/docker-mariadb) 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 | MariaDB container with [Appwrite server](https://appwrite.io) DB schema and tables initialized and ready to use for fresh Appwrite installation. This server is only extending the official MariaDB docker image with Appwrite schemas and tables already installed, for a fresh installation of MariaDB use only [docker official image](https://hub.docker.com/_/mariadb). 10 | 11 | ## Getting Started 12 | 13 | These instructions will cover usage information to help your run Appwrite's MariaDB docker container. 14 | 15 | ### Prerequisites 16 | 17 | In order to run this container you'll need docker installed. 18 | 19 | * [Windows](https://docs.docker.com/windows/started) 20 | * [OS X](https://docs.docker.com/mac/started/) 21 | * [Linux](https://docs.docker.com/linux/started/) 22 | 23 | ### Usage 24 | 25 | ```shell 26 | docker run appwrite/mariadb 27 | ``` 28 | 29 | ### Environment Variables 30 | 31 | This container supports all environment variables supplied by the official MariaDB Docker image. 32 | 33 | ### Build 34 | 35 | ```bash 36 | docker build --tag appwrite/mariadb:1.3.0 . 37 | 38 | docker push appwrite/mariadb:1.3.0 39 | ``` 40 | 41 | Multi-arch build (experimental using [buildx](https://github.com/docker/buildx)): 42 | 43 | ``` 44 | docker buildx build --platform linux/amd64,linux/arm64/v8,linux/ppc64le --tag appwrite/mariadb:1.3.0 --push . 45 | ``` 46 | 47 | ## Find Us 48 | 49 | * [GitHub](https://github.com/appwrite) 50 | * [Discord](https://appwrite.io/discord) 51 | * [Twitter](https://twitter.com/appwrite) 52 | 53 | ## Copyright and license 54 | 55 | The MIT License (MIT) [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php) 56 | -------------------------------------------------------------------------------- /.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: docker-mariadb-version 36 | attributes: 37 | label: "🎲 Docker-MariaDB version" 38 | description: "What version (Tag) of Docker-MariaDB are you running?" 39 | options: 40 | - Version 1.5.0 41 | - Version 1.4.0 42 | - Version 1.2.0 43 | - Version 1.1.0 44 | - Version 1.0.3 45 | - Version 1.0.2 46 | - Version 1.0.1 47 | - Version 1.0.0 48 | - Different version (specify in environment) 49 | validations: 50 | required: true 51 | - type: dropdown 52 | id: operating-system 53 | attributes: 54 | label: "💻 Operating system" 55 | description: "What OS is your server / device running on?" 56 | options: 57 | - Linux 58 | - MacOS 59 | - Windows 60 | - Something else 61 | validations: 62 | required: true 63 | - type: textarea 64 | id: enviromnemt 65 | validations: 66 | required: false 67 | attributes: 68 | label: "🧱 Your Environment" 69 | description: "Is your environment customized in any way?" 70 | placeholder: "I use Cloudflare for ..." 71 | - type: checkboxes 72 | id: no-duplicate-issues 73 | attributes: 74 | label: "👀 Have you spent some time to check if this issue has been raised before?" 75 | description: "Have you Googled for a similar issue or checked our older issues for a similar bug?" 76 | options: 77 | - label: "I checked and didn't find similar issue" 78 | required: true 79 | - type: checkboxes 80 | id: read-code-of-conduct 81 | attributes: 82 | label: "🏢 Have you read the Code of Conduct?" 83 | options: 84 | - label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)" 85 | required: true -------------------------------------------------------------------------------- /all.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS `appwrite` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; 2 | 3 | USE `appwrite`; 4 | 5 | CREATE TABLE IF NOT EXISTS `template.abuse.abuse` ( 6 | `id` int(11) NOT NULL AUTO_INCREMENT, 7 | `_key` varchar(255) NOT NULL, 8 | `_time` int(11) NOT NULL, 9 | `_count` int(11) NOT NULL DEFAULT '0', 10 | PRIMARY KEY (`id`), 11 | UNIQUE KEY `unique1` (`_key`,`_time`), 12 | KEY `index1` (`_key`,`_time`) 13 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 14 | 15 | CREATE TABLE IF NOT EXISTS `template.audit.audit` ( 16 | `id` int(11) NOT NULL AUTO_INCREMENT, 17 | `userId` varchar(45) NOT NULL, 18 | `event` varchar(45) NOT NULL, 19 | `resource` varchar(45) DEFAULT NULL, 20 | `userAgent` text NOT NULL, 21 | `ip` varchar(45) NOT NULL, 22 | `location` varchar(45) DEFAULT NULL, 23 | `time` datetime NOT NULL, 24 | `data` longtext DEFAULT NULL, 25 | PRIMARY KEY (`id`), 26 | UNIQUE KEY `id_UNIQUE` (`id`), 27 | KEY `index_1` (`userId`), 28 | KEY `index_2` (`event`), 29 | KEY `index_3` (`resource`) 30 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 31 | 32 | CREATE TABLE IF NOT EXISTS `template.database.documents` ( 33 | `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID for each node', 34 | `uid` varchar(45) DEFAULT NULL, 35 | `status` int(11) NOT NULL DEFAULT 0, 36 | `createdAt` datetime DEFAULT NULL, 37 | `updatedAt` datetime DEFAULT NULL, 38 | `signature` varchar(32) NOT NULL, 39 | `revision` varchar(45) NOT NULL, 40 | `permissions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, 41 | PRIMARY KEY (`id`), 42 | UNIQUE KEY `id_UNIQUE` (`id`), 43 | UNIQUE KEY `index2` (`uid`), 44 | KEY `index3` (`signature`,`uid`,`revision`) 45 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 46 | 47 | CREATE TABLE IF NOT EXISTS `template.database.properties` ( 48 | `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary Key', 49 | `documentUid` varchar(45) NOT NULL COMMENT 'Unique UID foreign key', 50 | `documentRevision` varchar(45) NOT NULL, 51 | `key` varchar(32) NOT NULL COMMENT 'Property key name', 52 | `value` text NOT NULL COMMENT 'Value of property', 53 | `primitive` varchar(32) NOT NULL COMMENT 'Primitive type of property value', 54 | `array` tinyint(4) NOT NULL DEFAULT 0, 55 | `order` int(11) NOT NULL, 56 | PRIMARY KEY (`id`), 57 | KEY `index1` (`documentUid`), 58 | KEY `index2` (`key`,`value`(5)), 59 | FULLTEXT KEY `index3` (`value`) 60 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 61 | 62 | CREATE TABLE IF NOT EXISTS `template.database.relationships` ( 63 | `id` int(11) NOT NULL AUTO_INCREMENT, 64 | `revision` varchar(45) NOT NULL, 65 | `start` varchar(45) NOT NULL COMMENT 'Unique UID foreign key', 66 | `end` varchar(45) NOT NULL COMMENT 'Unique UID foreign key', 67 | `key` varchar(256) NOT NULL, 68 | `path` int(11) NOT NULL DEFAULT 0, 69 | `array` tinyint(4) NOT NULL DEFAULT 0, 70 | `order` int(11) NOT NULL DEFAULT 0, 71 | PRIMARY KEY (`id`), 72 | KEY `relationships_start_nodes_id_idx` (`start`), 73 | KEY `relationships_end_nodes_id_idx` (`end`) 74 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 75 | 76 | CREATE TABLE IF NOT EXISTS `template.database.unique` ( 77 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 78 | `key` varchar(128) DEFAULT NULL, 79 | PRIMARY KEY (`id`), 80 | UNIQUE KEY `index1` (`key`) 81 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 82 | 83 | /* Default App */ 84 | 85 | CREATE TABLE IF NOT EXISTS `app_console.database.documents` LIKE `template.database.documents`; 86 | CREATE TABLE IF NOT EXISTS `app_console.database.properties` LIKE `template.database.properties`; 87 | CREATE TABLE IF NOT EXISTS `app_console.database.relationships` LIKE `template.database.relationships`; 88 | CREATE TABLE IF NOT EXISTS `app_console.database.unique` LIKE `template.database.unique`; 89 | CREATE TABLE IF NOT EXISTS `app_console.audit.audit` LIKE `template.audit.audit`; 90 | CREATE TABLE IF NOT EXISTS `app_console.abuse.abuse` LIKE `template.abuse.abuse`; --------------------------------------------------------------------------------