Merge branch '0.7.x' of github.com:appwrite/appwrite into feat-delete-user

This commit is contained in:
Eldad Fux
2020-08-29 23:40:40 +03:00
607 changed files with 21828 additions and 6638 deletions
+2 -1
View File
@@ -6,4 +6,5 @@ public/styles
.git
.idea
.cd .babelrc
.DS_Store
.DS_Store
debug
+23
View File
@@ -0,0 +1,23 @@
_APP_ENV=production
_APP_ENV=development
_APP_OPTIONS_ABUSE=disabled
_APP_OPTIONS_FORCE_HTTPS=disabled
_APP_OPENSSL_KEY_V1=your-secret-key
_APP_DOMAIN=demo.appwrite.io
_APP_DOMAIN_TARGET=demo.appwrite.io
_APP_REDIS_HOST=redis
_APP_REDIS_PORT=6379
_APP_DB_HOST=mariadb
_APP_DB_PORT=3306
_APP_DB_SCHEMA=appwrite
_APP_DB_USER=user
_APP_DB_PASS=password
_APP_INFLUXDB_HOST=influxdb
_APP_INFLUXDB_PORT=8086
_APP_STATSD_HOST=telegraf
_APP_STATSD_PORT=8125
_APP_SMTP_HOST=maildev
_APP_SMTP_PORT=25
_APP_STORAGE_LIMIT=100000000
_APP_FUNCTIONS_TIMEOUT=900
_APP_FUNCTIONS_CONTAINERS=10
+1 -6
View File
@@ -1,12 +1,7 @@
/.vscode/
/vendor/
/node_modules/
/storage/uploads/
/storage/cache
/storage/db
/storage/influxdb
/tests/resources/storage/
/.idea/
.DS_Store
.php_cs.cache
.env
.php_cs.cache
+9 -1
View File
@@ -14,6 +14,12 @@ notifications:
services:
- docker
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
# cache:
# directories:
# - docker_images
@@ -25,9 +31,11 @@ services:
# - docker save -o docker_images/images.tar appwrite_appwrite
install:
- docker --version
- docker-compose up -d
- sleep 90
script:
- docker ps
- docker exec appwrite test
- docker-compose logs appwrite
- docker exec appwrite test
+13 -4
View File
@@ -19,6 +19,19 @@
- Upgraded ClamAV container image to version 1.0.11 ([#412](https://github.com/appwrite/appwrite/issues/412))
- Optimised function execution by using fully-qualified function calls
- Added support for boolean 'true' and 'false' in query strings alongside 1 and 0
- Added pagination for projects list on the console home page.
- Updated storage calculation to match IEC standards
- Now using Alpine as base Docker image
- New and consistent response format for all API object + new response examples in the docs
- Removed user roles attribute from user object (can be fetched from /v1/teams/memberships) **
- Removed type attribute from session object response (used only internally)
- ** - might be changed before merging to master
## Breaking Changes (Read before upgrading!)
- **Deprecated** `first` and `last` query params for documents list route in the database API
- **Deprecated** Deprectaed Pubjabi Translations ('pn')
- Switched order of limit and offset params in all the SDKs `listDocuments` method for better consistency
- Default `limit` param value in all the SDKs `listDocuments` method is now 25 for better consistency
## Bug Fixes
@@ -41,10 +54,6 @@
- New OAuth adapter for PayPal sandbox
- Fixed a bug making read permission overwrite write permission in some cases
## Breaking Changes
- **Deprecated** `first` and `last` query params for documents list route in the database API
- **Deprecated** Deprectaed Pubjabi Translations ('pn')
## Security
- Access to Health API now requires authentication with an API Key with access to `health.read` scope allowed
+22 -3
View File
@@ -107,8 +107,6 @@ Currently, all of the Appwrite microservices are intended to communicate using t
Security and privacy are extremely important to Appwrite, developers, and users alike. Make sure to follow the best industry standards and practices.
<!-- To help you make sure you are doing as best as possible, we have set up our security checklist for pull requests and contributors. Please make sure to follow the list before sending a pull request. -->
## Dependencies
Please avoid introducing new dependencies to Appwrite without consulting the team. New dependencies can be very helpful but also introduce new security and privacy issues, complexity, and impact total docker image size.
@@ -148,7 +146,7 @@ After finishing the installation process, you can start writing and editing code
To build a new version of the Appwrite server, all you need to do is run the build.sh file like this:
```bash
bash ./build.sh 1.0.0
bash ./build.sh X.X.X
```
Before running the command, make sure you have proper write permissions to the Appwrite docker hub team.
@@ -167,6 +165,27 @@ To run tests manually, run phpunit from your command line:
docker exec appwrite test
```
## Benchmarking
You can use WRK Docker image to benchmark the server performance. Benchmarking is extremely useful when you want to compare how the server behaves before and after a change has been applied. Replace [APPWRITE_HOSTNAME_OR_IP] with your Appwrite server hostname or IP. Note that localhost is not accessible from inside the WRK container.
```
Options:
-c, --connections <N> Connections to keep open
-d, --duration <T> Duration of test
-t, --threads <N> Number of threads to use
-s, --script <S> Load Lua script file
-H, --header <H> Add header to request
--latency Print latency statistics
--timeout <T> Socket/request timeout
-v, --version Print version details
```
```bash
docker run --rm skandyla/wrk -t3 -c100 -d30 https://[APPWRITE_HOSTNAME_OR_IP]
```
## Code Maintenance
We use some automation tools to help us keep a healthy code base.
Regular → Executable
+107 -113
View File
@@ -1,56 +1,65 @@
FROM ubuntu:18.04 AS builder
LABEL maintainer="team@appwrite.io"
FROM composer:2.0 as step0
ARG TESTING=false
ENV TZ=Asia/Tel_Aviv \
DEBIAN_FRONTEND=noninteractive \
PHP_VERSION=7.4 \
PHP_REDIS_VERSION=5.2.1
RUN \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests ca-certificates software-properties-common wget git openssl && \
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests make php$PHP_VERSION php$PHP_VERSION-dev zip unzip php$PHP_VERSION-zip && \
# Redis Extension
wget -q https://github.com/phpredis/phpredis/archive/$PHP_REDIS_VERSION.tar.gz && \
tar -xf $PHP_REDIS_VERSION.tar.gz && \
cd phpredis-$PHP_REDIS_VERSION && \
phpize$PHP_VERSION && \
./configure && \
make && \
# Composer
wget https://getcomposer.org/composer.phar && \
chmod +x ./composer.phar && \
mv ./composer.phar /usr/bin/composer && \
#Brotli
cd / && \
git clone https://github.com/eustas/ngx_brotli.git && \
cd ngx_brotli && git submodule update --init && cd ..
ENV TESTING=$TESTING
WORKDIR /usr/local/src/
# Updating PHP Dependencies and Auto-loading...
ENV TESTING=$TESTING
COPY composer.* /usr/local/src/
COPY composer.lock /usr/local/src/
COPY composer.json /usr/local/src/
RUN composer update --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
FROM ubuntu:18.04
FROM php:7.4-cli-alpine as step1
ENV TZ=Asia/Tel_Aviv \
PHP_REDIS_VERSION=5.3.0 \
PHP_SWOOLE_VERSION=4.5.2 \
PHP_XDEBUG_VERSION=sdebug_2_9-beta
RUN \
apk add --no-cache --virtual .deps \
make \
automake \
autoconf \
gcc \
g++ \
tar \
wget \
git \
zlib-dev \
brotli-dev
RUN docker-php-ext-install sockets
RUN \
# Redis Extension
wget -q https://github.com/phpredis/phpredis/archive/$PHP_REDIS_VERSION.tar.gz && \
tar -xf $PHP_REDIS_VERSION.tar.gz && \
cd phpredis-$PHP_REDIS_VERSION && \
phpize && \
./configure && \
make && make install && \
cd .. && \
## Swoole Extension
git clone https://github.com/swoole/swoole-src.git && \
cd swoole-src && \
git checkout v$PHP_SWOOLE_VERSION && \
phpize && \
./configure --enable-sockets --enable-http2 && \
make && make install && \
cd ..
FROM php:7.4-cli-alpine as final
LABEL maintainer="team@appwrite.io"
ARG VERSION=dev
ENV TZ=Asia/Tel_Aviv \
DEBIAN_FRONTEND=noninteractive \
PHP_VERSION=7.4 \
_APP_SERVER=swoole \
_APP_ENV=production \
_APP_DOMAIN=localhost \
_APP_DOMAIN_TARGET=localhost \
@@ -59,7 +68,7 @@ ENV TZ=Asia/Tel_Aviv \
_APP_OPTIONS_ABUSE=enabled \
_APP_OPTIONS_FORCE_HTTPS=disabled \
_APP_OPENSSL_KEY_V1=your-secret-key \
_APP_STORAGE_LIMIT=104857600 \
_APP_STORAGE_LIMIT=100000000 \
_APP_STORAGE_ANTIVIRUS=enabled \
_APP_REDIS_HOST=redis \
_APP_REDIS_PORT=6379 \
@@ -74,106 +83,91 @@ ENV TZ=Asia/Tel_Aviv \
_APP_STATSD_PORT=8125 \
_APP_SMTP_HOST=smtp \
_APP_SMTP_PORT=25 \
_APP_FUNCTIONS_TIMEOUT=900 \
_APP_FUNCTIONS_CONTAINERS=10 \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION
#ENV _APP_SMTP_SECURE ''
#ENV _APP_SMTP_USERNAME ''
#ENV _APP_SMTP_PASSWORD ''
COPY --from=builder /phpredis-5.2.1/modules/redis.so /usr/lib/php/20190902/
COPY --from=builder /phpredis-5.2.1/modules/redis.so /usr/lib/php/20190902/
COPY --from=builder /ngx_brotli /ngx_brotli
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests wget ca-certificates software-properties-common build-essential libpcre3-dev zlib1g-dev libssl-dev openssl gnupg htop supervisor && \
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \
add-apt-repository universe && \
add-apt-repository ppa:certbot/certbot && \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests php$PHP_VERSION php$PHP_VERSION-fpm \
php$PHP_VERSION-mysqlnd php$PHP_VERSION-curl php$PHP_VERSION-imagick php$PHP_VERSION-mbstring php$PHP_VERSION-dom webp certbot && \
# Nginx
wget http://nginx.org/download/nginx-1.19.0.tar.gz && \
tar -xzvf nginx-1.19.0.tar.gz && rm nginx-1.19.0.tar.gz && \
cd nginx-1.19.0 && \
./configure --prefix=/usr/share/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--user=www-data \
--group=www-data \
--build=Ubuntu \
--with-http_gzip_static_module \
--with-http_ssl_module \
--with-http_v2_module \
--add-module=/ngx_brotli && \
make && \
make install && \
rm -rf ../nginx-1.19.0 && \
# Redis Extension
echo extension=redis.so >> /etc/php/$PHP_VERSION/fpm/conf.d/redis.ini && \
echo extension=redis.so >> /etc/php/$PHP_VERSION/cli/conf.d/redis.ini && \
# Cleanup
cd ../ && \
apt-get purge -y --auto-remove wget software-properties-common build-essential libpcre3-dev zlib1g-dev libssl-dev gnupg && \
apt-get clean && \
rm -rf /ngx_brotli && \
rm -rf /var/lib/apt/lists/*
apk update \
&& apk add --no-cache --virtual .deps \
make \
automake \
autoconf \
gcc \
g++ \
curl-dev \
&& apk add --no-cache \
libstdc++ \
yaml-dev \
imagemagick \
imagemagick-dev \
certbot \
docker-cli \
&& pecl install imagick yaml \
&& docker-php-ext-enable imagick yaml \
&& docker-php-ext-install sockets opcache pdo_mysql \
&& apk del .deps
# Set Upload Limit (default to 100MB)
RUN echo "upload_max_filesize = ${_APP_STORAGE_LIMIT}" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini
RUN echo "post_max_size = ${_APP_STORAGE_LIMIT}" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini
WORKDIR /usr/src/code
# Add logs file
RUN echo "" >> /var/log/appwrite.log
COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor
COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
# Nginx Configuration (with self-signed ssl certificates)
COPY ./docker/nginx.conf.template /etc/nginx/nginx.conf.template
COPY ./docker/ssl/cert.pem /etc/nginx/ssl/cert.pem
COPY ./docker/ssl/key.pem /etc/nginx/ssl/key.pem
# PHP Configuration
RUN mkdir -p /var/run/php
COPY ./docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf
# Add PHP Source Code
COPY ./app /usr/share/nginx/html/app
# Add Source Code
COPY ./app /usr/src/code/app
COPY ./bin /usr/local/bin
COPY ./docs /usr/share/nginx/html/docs
COPY ./public /usr/share/nginx/html/public
COPY ./src /usr/share/nginx/html/src
COPY --from=builder /usr/local/src/vendor /usr/share/nginx/html/vendor
COPY ./docs /usr/src/code/docs
COPY ./public /usr/src/code/public
COPY ./src /usr/src/code/src
# Set Volumes
RUN mkdir -p /storage/uploads && \
mkdir -p /storage/cache && \
mkdir -p /storage/config && \
mkdir -p /storage/certificates && \
mkdir -p /storage/functions && \
mkdir -p /storage/debug && \
chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates
# Supervisord Conf
COPY ./docker/supervisord.conf /etc/supervisord.conf
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \
chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug
# Executables
RUN chmod +x /usr/local/bin/start
RUN chmod +x /usr/local/bin/doctor
RUN chmod +x /usr/local/bin/migrate
RUN chmod +x /usr/local/bin/test
RUN chmod +x /usr/local/bin/doctor && \
chmod +x /usr/local/bin/install && \
chmod +x /usr/local/bin/migrate && \
chmod +x /usr/local/bin/schedule && \
chmod +x /usr/local/bin/ssl && \
chmod +x /usr/local/bin/test && \
chmod +x /usr/local/bin/worker-audits && \
chmod +x /usr/local/bin/worker-certificates && \
chmod +x /usr/local/bin/worker-deletes && \
chmod +x /usr/local/bin/worker-functions && \
chmod +x /usr/local/bin/worker-mails && \
chmod +x /usr/local/bin/worker-tasks && \
chmod +x /usr/local/bin/worker-usage && \
chmod +x /usr/local/bin/worker-webhooks
# Letsencrypt Permissions
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
# Enable Extensions
RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini
RUN echo "opcache.preload_user=www-data" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.enable_cli = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
EXPOSE 80
WORKDIR /usr/share/nginx/html
CMD ["/bin/bash", "/usr/local/bin/start"]
CMD [ "php", "app/http.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
+178
View File
@@ -0,0 +1,178 @@
FROM composer:2.0 as step0
ARG TESTING=false
ENV TESTING=$TESTING
WORKDIR /usr/local/src/
COPY composer.lock /usr/local/src/
COPY composer.json /usr/local/src/
RUN composer update --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
FROM php:8.0.0alpha1-cli-alpine as step1
ENV TZ=Asia/Tel_Aviv \
DEBIAN_FRONTEND=noninteractive \
PHP_REDIS_VERSION=5.3.0 \
PHP_SWOOLE_VERSION=4.5.2 \
PHP_XDEBUG_VERSION=sdebug_2_9-beta
RUN \
apk update && \
apk add ca-certificates gcc make g++ autoconf wget git openssl make zip unzip brotli zlib
RUN docker-php-ext-install sockets
RUN \
# Redis Extension
wget -q https://github.com/phpredis/phpredis/archive/$PHP_REDIS_VERSION.tar.gz && \
tar -xf $PHP_REDIS_VERSION.tar.gz && \
cd phpredis-$PHP_REDIS_VERSION && \
phpize && \
./configure && \
make && make install && \
cd .. && \
## Swoole Extension
git clone https://github.com/swoole/swoole-src.git && \
cd swoole-src && \
#git checkout v$PHP_SWOOLE_VERSION && \
phpize && \
./configure --enable-sockets --enable-http2 && \
make && make install && \
cd ..
## XDebug Extension
# git clone https://github.com/swoole/sdebug.git && \
# cd sdebug && \
# git checkout $PHP_XDEBUG_VERSION && \
# phpize && \
# ./configure --enable-xdebug && \
# make clean && make && make install
# cd .. && \
# Meminfo Extension
# git clone https://github.com/BitOne/php-meminfo.git && \
# cd php-meminfo && \
# git checkout v1.0.5 && \
# cd extension/php7 && \
# phpize && \
# ./configure --enable-meminfo && \
# make && make install
FROM php:8.0.0alpha1-cli-alpine as final
LABEL maintainer="team@appwrite.io"
ARG VERSION=dev
ENV TZ=Asia/Tel_Aviv \
DEBIAN_FRONTEND=noninteractive \
_APP_SERVER=swoole \
_APP_ENV=production \
_APP_DOMAIN=localhost \
_APP_DOMAIN_TARGET=localhost \
_APP_HOME=https://appwrite.io \
_APP_EDITION=community \
_APP_OPTIONS_ABUSE=enabled \
_APP_OPTIONS_FORCE_HTTPS=disabled \
_APP_OPENSSL_KEY_V1=your-secret-key \
_APP_STORAGE_LIMIT=100000000 \
_APP_STORAGE_ANTIVIRUS=enabled \
_APP_REDIS_HOST=redis \
_APP_REDIS_PORT=6379 \
_APP_DB_HOST=mariadb \
_APP_DB_PORT=3306 \
_APP_DB_USER=root \
_APP_DB_PASS=password \
_APP_DB_SCHEMA=appwrite \
_APP_INFLUXDB_HOST=influxdb \
_APP_INFLUXDB_PORT=8086 \
_APP_STATSD_HOST=telegraf \
_APP_STATSD_PORT=8125 \
_APP_SMTP_HOST=smtp \
_APP_SMTP_PORT=25 \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION
#ENV _APP_SMTP_SECURE ''
#ENV _APP_SMTP_USERNAME ''
#ENV _APP_SMTP_PASSWORD ''
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN \
apk update && \
apk add libwebp certbot htop procps \
oniguruma libcurl imagemagick-libs yaml-dev brotli-libs zlib-dev
# pecl install imagick yaml && \
# docker-php-ext-enable imagick yaml
RUN docker-php-ext-install sockets curl opcache pdo pdo_mysql
WORKDIR /usr/src/code
COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor
COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190128/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20190128/
COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190128/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20190128/
# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190128/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20190128/
# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190128/meminfo.so /usr/local/lib/php/extensions/no-debug-non-zts-20190128/
# Add Source Code
COPY ./app /usr/src/code/app
COPY ./bin /usr/local/bin
COPY ./docs /usr/src/code/docs
COPY ./public /usr/src/code/public
COPY ./src /usr/src/code/src
# Set Volumes
RUN mkdir -p /storage/uploads && \
mkdir -p /storage/cache && \
mkdir -p /storage/config && \
mkdir -p /storage/certificates && \
mkdir -p /storage/functions && \
mkdir -p /storage/debug && \
chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \
chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug
# Executables
RUN chmod +x /usr/local/bin/doctor
RUN chmod +x /usr/local/bin/migrate
RUN chmod +x /usr/local/bin/schedule
RUN chmod +x /usr/local/bin/test
RUN chmod +x /usr/local/bin/worker-audits
RUN chmod +x /usr/local/bin/worker-certificates
RUN chmod +x /usr/local/bin/worker-deletes
RUN chmod +x /usr/local/bin/worker-functions
RUN chmod +x /usr/local/bin/worker-mails
RUN chmod +x /usr/local/bin/worker-tasks
RUN chmod +x /usr/local/bin/worker-usage
RUN chmod +x /usr/local/bin/worker-webhooks
# Letsencrypt Permissions
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
# Enable Extensions
RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini
# RUN echo zend_extension=xdebug.so >> /usr/local/etc/php/conf.d/xdebug.ini
# RUN echo extension=meminfo.so >> /usr/local/etc/php/conf.d/meminfo.ini
RUN echo "opcache.preload_user=www-data" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.enable_cli = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.profiler_enable = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.profiler_output_dir = /tmp/" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.profiler_enable_trigger = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.trace_format = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
EXPOSE 80
#, "-dxdebug.auto_trace=1"
#, "-dxdebug.profiler_enable=1"
#, "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php"
CMD [ "php", "app/server.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
+180
View File
@@ -0,0 +1,180 @@
FROM composer:2.0 as step0
ARG TESTING=false
ENV TESTING=$TESTING
WORKDIR /usr/local/src/
COPY composer.lock /usr/local/src/
COPY composer.json /usr/local/src/
RUN composer update --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
FROM php:7.4-cli as step1
ENV TZ=Asia/Tel_Aviv \
DEBIAN_FRONTEND=noninteractive \
PHP_REDIS_VERSION=5.3.0 \
PHP_SWOOLE_VERSION=4.5.2 \
PHP_XDEBUG_VERSION=sdebug_2_9-beta
RUN \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests ca-certificates software-properties-common wget git openssl make zip unzip libbrotli-dev libz-dev
RUN docker-php-ext-install sockets
RUN \
# Redis Extension
wget -q https://github.com/phpredis/phpredis/archive/$PHP_REDIS_VERSION.tar.gz && \
tar -xf $PHP_REDIS_VERSION.tar.gz && \
cd phpredis-$PHP_REDIS_VERSION && \
phpize && \
./configure && \
make && make install && \
cd .. && \
## Swoole Extension
git clone https://github.com/swoole/swoole-src.git && \
cd swoole-src && \
git checkout v$PHP_SWOOLE_VERSION && \
phpize && \
./configure --enable-sockets --enable-http2 && \
make && make install && \
cd ..
## XDebug Extension
# git clone https://github.com/swoole/sdebug.git && \
# cd sdebug && \
# git checkout $PHP_XDEBUG_VERSION && \
# phpize && \
# ./configure --enable-xdebug && \
# make clean && make && make install
# cd .. && \
# Meminfo Extension
# git clone https://github.com/BitOne/php-meminfo.git && \
# cd php-meminfo && \
# git checkout v1.0.5 && \
# cd extension/php7 && \
# phpize && \
# ./configure --enable-meminfo && \
# make && make install
FROM php:7.4-cli as final
LABEL maintainer="team@appwrite.io"
ARG VERSION=dev
ENV TZ=Asia/Tel_Aviv \
DEBIAN_FRONTEND=noninteractive \
_APP_SERVER=swoole \
_APP_ENV=production \
_APP_DOMAIN=localhost \
_APP_DOMAIN_TARGET=localhost \
_APP_HOME=https://appwrite.io \
_APP_EDITION=community \
_APP_OPTIONS_ABUSE=enabled \
_APP_OPTIONS_FORCE_HTTPS=disabled \
_APP_OPENSSL_KEY_V1=your-secret-key \
_APP_STORAGE_LIMIT=100000000 \
_APP_STORAGE_ANTIVIRUS=enabled \
_APP_REDIS_HOST=redis \
_APP_REDIS_PORT=6379 \
_APP_DB_HOST=mariadb \
_APP_DB_PORT=3306 \
_APP_DB_USER=root \
_APP_DB_PASS=password \
_APP_DB_SCHEMA=appwrite \
_APP_INFLUXDB_HOST=influxdb \
_APP_INFLUXDB_PORT=8086 \
_APP_STATSD_HOST=telegraf \
_APP_STATSD_PORT=8125 \
_APP_SMTP_HOST=smtp \
_APP_SMTP_PORT=25 \
_APP_FUNCTIONS_TIMEOUT=900 \
_APP_FUNCTIONS_CONTAINERS=10 \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION
#ENV _APP_SMTP_SECURE ''
#ENV _APP_SMTP_USERNAME ''
#ENV _APP_SMTP_PASSWORD ''
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests webp certbot htop procps docker.io \
libonig-dev libcurl4-gnutls-dev libmagickwand-dev libyaml-dev libbrotli-dev libz-dev && \
pecl install imagick yaml && \
docker-php-ext-enable imagick yaml
RUN docker-php-ext-install sockets curl opcache pdo pdo_mysql
WORKDIR /usr/src/code
COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor
COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/meminfo.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
# Add Source Code
COPY ./app /usr/src/code/app
COPY ./bin /usr/local/bin
COPY ./docs /usr/src/code/docs
COPY ./public /usr/src/code/public
COPY ./src /usr/src/code/src
# Set Volumes
RUN mkdir -p /storage/uploads && \
mkdir -p /storage/cache && \
mkdir -p /storage/config && \
mkdir -p /storage/certificates && \
mkdir -p /storage/functions && \
mkdir -p /storage/debug && \
chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \
chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug
# Executables
RUN chmod +x /usr/local/bin/doctor
RUN chmod +x /usr/local/bin/migrate
RUN chmod +x /usr/local/bin/schedule
RUN chmod +x /usr/local/bin/test
RUN chmod +x /usr/local/bin/worker-audits
RUN chmod +x /usr/local/bin/worker-certificates
RUN chmod +x /usr/local/bin/worker-deletes
RUN chmod +x /usr/local/bin/worker-functions
RUN chmod +x /usr/local/bin/worker-mails
RUN chmod +x /usr/local/bin/worker-tasks
RUN chmod +x /usr/local/bin/worker-usage
RUN chmod +x /usr/local/bin/worker-webhooks
# Letsencrypt Permissions
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
# Enable Extensions
RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini
# RUN echo zend_extension=xdebug.so >> /usr/local/etc/php/conf.d/xdebug.ini
# RUN echo extension=meminfo.so >> /usr/local/etc/php/conf.d/meminfo.ini
RUN echo "opcache.preload_user=www-data" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.enable_cli = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.profiler_enable = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.profiler_output_dir = /tmp/" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.profiler_enable_trigger = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.trace_format = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
EXPOSE 80
#, "-dxdebug.auto_trace=1"
#, "-dxdebug.profiler_enable=1"
#, "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php"
CMD [ "php", "app/server.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
+185
View File
@@ -0,0 +1,185 @@
FROM ubuntu:18.04 AS builder
LABEL maintainer="team@appwrite.io"
ARG TESTING=false
ENV TZ=Asia/Tel_Aviv \
DEBIAN_FRONTEND=noninteractive \
PHP_VERSION=7.4 \
PHP_REDIS_VERSION=5.2.1
RUN \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests ca-certificates software-properties-common wget git openssl && \
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests make php$PHP_VERSION php$PHP_VERSION-dev zip unzip php$PHP_VERSION-zip && \
# Redis Extension
wget -q https://github.com/phpredis/phpredis/archive/$PHP_REDIS_VERSION.tar.gz && \
tar -xf $PHP_REDIS_VERSION.tar.gz && \
cd phpredis-$PHP_REDIS_VERSION && \
phpize$PHP_VERSION && \
./configure && \
make && \
# Composer
wget https://getcomposer.org/composer.phar && \
chmod +x ./composer.phar && \
mv ./composer.phar /usr/bin/composer && \
#Brotli
cd / && \
git clone https://github.com/eustas/ngx_brotli.git && \
cd ngx_brotli && git submodule update --init && cd ..
WORKDIR /usr/local/src/
# Updating PHP Dependencies and Auto-loading...
ENV TESTING=$TESTING
COPY composer.* /usr/local/src/
RUN composer update --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
FROM ubuntu:18.04
LABEL maintainer="team@appwrite.io"
ARG VERSION=dev
ENV TZ=Asia/Tel_Aviv \
DEBIAN_FRONTEND=noninteractive \
PHP_VERSION=7.4 \
_APP_SERVER=nginx \
_APP_ENV=production \
_APP_DOMAIN=localhost \
_APP_DOMAIN_TARGET=localhost \
_APP_HOME=https://appwrite.io \
_APP_EDITION=community \
_APP_OPTIONS_ABUSE=enabled \
_APP_OPTIONS_FORCE_HTTPS=disabled \
_APP_OPENSSL_KEY_V1=your-secret-key \
_APP_STORAGE_LIMIT=100000000 \
_APP_STORAGE_ANTIVIRUS=enabled \
_APP_REDIS_HOST=redis \
_APP_REDIS_PORT=6379 \
_APP_DB_HOST=mariadb \
_APP_DB_PORT=3306 \
_APP_DB_USER=root \
_APP_DB_PASS=password \
_APP_DB_SCHEMA=appwrite \
_APP_INFLUXDB_HOST=influxdb \
_APP_INFLUXDB_PORT=8086 \
_APP_STATSD_HOST=telegraf \
_APP_STATSD_PORT=8125 \
_APP_SMTP_HOST=smtp \
_APP_SMTP_PORT=25 \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION
#ENV _APP_SMTP_SECURE ''
#ENV _APP_SMTP_USERNAME ''
#ENV _APP_SMTP_PASSWORD ''
COPY --from=builder /phpredis-5.2.1/modules/redis.so /usr/lib/php/20190902/
COPY --from=builder /phpredis-5.2.1/modules/redis.so /usr/lib/php/20190902/
COPY --from=builder /ngx_brotli /ngx_brotli
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests wget ca-certificates software-properties-common build-essential libpcre3-dev zlib1g-dev libssl-dev openssl gnupg htop supervisor && \
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \
add-apt-repository universe && \
add-apt-repository ppa:certbot/certbot && \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests php$PHP_VERSION php$PHP_VERSION-fpm \
php$PHP_VERSION-mysqlnd php$PHP_VERSION-curl php$PHP_VERSION-imagick php$PHP_VERSION-mbstring php$PHP_VERSION-dom certbot && \
# Nginx
wget http://nginx.org/download/nginx-1.19.0.tar.gz && \
tar -xzvf nginx-1.19.0.tar.gz && rm nginx-1.19.0.tar.gz && \
cd nginx-1.19.0 && \
./configure --prefix=/usr/share/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--user=www-data \
--group=www-data \
--build=Ubuntu \
--with-http_gzip_static_module \
--with-http_ssl_module \
--with-http_v2_module \
--add-module=/ngx_brotli && \
make && \
make install && \
rm -rf ../nginx-1.19.0 && \
# Redis Extension
echo extension=redis.so >> /etc/php/$PHP_VERSION/fpm/conf.d/redis.ini && \
echo extension=redis.so >> /etc/php/$PHP_VERSION/cli/conf.d/redis.ini && \
# Cleanup
cd ../ && \
apt-get purge -y --auto-remove wget software-properties-common build-essential libpcre3-dev zlib1g-dev libssl-dev gnupg && \
apt-get clean && \
rm -rf /ngx_brotli && \
rm -rf /var/lib/apt/lists/*
# Set Upload Limit (default to 100MB)
RUN echo "upload_max_filesize = ${_APP_STORAGE_LIMIT}" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini
RUN echo "post_max_size = ${_APP_STORAGE_LIMIT}" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini
RUN echo "opcache.preload_user=www-data" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini
RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini
RUN echo "opcache.enable_cli = 1" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini
# Add logs file
RUN echo "" >> /var/log/appwrite.log
# Nginx Configuration (with self-signed ssl certificates)
COPY ./docker/nginx.conf.template /etc/nginx/nginx.conf.template
COPY ./docker/ssl/cert.pem /etc/nginx/ssl/cert.pem
COPY ./docker/ssl/key.pem /etc/nginx/ssl/key.pem
# PHP Configuration
RUN mkdir -p /var/run/php
COPY ./docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf
# Add PHP Source Code
COPY ./app /usr/src/code/app
COPY ./bin /usr/local/bin
COPY ./docs /usr/src/code/docs
COPY ./public /usr/src/code/public
COPY ./src /usr/src/code/src
COPY --from=builder /usr/local/src/vendor /usr/src/code/vendor
RUN mkdir -p /storage/uploads && \
mkdir -p /storage/cache && \
mkdir -p /storage/config && \
mkdir -p /storage/certificates && \
mkdir -p /storage/functions && \
chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions
# Supervisord Conf
COPY ./docker/supervisord.conf /etc/supervisord.conf
# Executables
RUN chmod +x /usr/local/bin/start
RUN chmod +x /usr/local/bin/doctor
RUN chmod +x /usr/local/bin/migrate
RUN chmod +x /usr/local/bin/test
# Letsencrypt Permissions
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
EXPOSE 80
WORKDIR /usr/src/code
CMD ["/bin/bash", "/usr/local/bin/start"]
+178
View File
@@ -0,0 +1,178 @@
FROM composer:2.0 as step0
ARG TESTING=false
ENV TESTING=$TESTING
WORKDIR /usr/local/src/
COPY composer.lock /usr/local/src/
COPY composer.json /usr/local/src/
RUN composer update --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
FROM php:8.0-rc as step1
ENV TZ=Asia/Tel_Aviv \
DEBIAN_FRONTEND=noninteractive \
PHP_REDIS_VERSION=5.3.0 \
PHP_SWOOLE_VERSION=4.5.2 \
PHP_XDEBUG_VERSION=sdebug_2_9-beta
RUN \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests ca-certificates software-properties-common wget git openssl make zip unzip libbrotli-dev libz-dev
RUN docker-php-ext-install sockets
RUN \
# Redis Extension
wget -q https://github.com/phpredis/phpredis/archive/$PHP_REDIS_VERSION.tar.gz && \
tar -xf $PHP_REDIS_VERSION.tar.gz && \
cd phpredis-$PHP_REDIS_VERSION && \
phpize && \
./configure && \
make && make install && \
cd .. && \
## Swoole Extension
git clone https://github.com/swoole/swoole-src.git && \
cd swoole-src && \
#git checkout v$PHP_SWOOLE_VERSION && \
phpize && \
./configure --enable-sockets --enable-http2 && \
make && make install && \
cd ..
## XDebug Extension
# git clone https://github.com/swoole/sdebug.git && \
# cd sdebug && \
# git checkout $PHP_XDEBUG_VERSION && \
# phpize && \
# ./configure --enable-xdebug && \
# make clean && make && make install
# cd .. && \
# Meminfo Extension
# git clone https://github.com/BitOne/php-meminfo.git && \
# cd php-meminfo && \
# git checkout v1.0.5 && \
# cd extension/php7 && \
# phpize && \
# ./configure --enable-meminfo && \
# make && make install
FROM php:8.0-rc as final
LABEL maintainer="team@appwrite.io"
ARG VERSION=dev
ENV TZ=Asia/Tel_Aviv \
DEBIAN_FRONTEND=noninteractive \
_APP_SERVER=swoole \
_APP_ENV=production \
_APP_DOMAIN=localhost \
_APP_DOMAIN_TARGET=localhost \
_APP_HOME=https://appwrite.io \
_APP_EDITION=community \
_APP_OPTIONS_ABUSE=enabled \
_APP_OPTIONS_FORCE_HTTPS=disabled \
_APP_OPENSSL_KEY_V1=your-secret-key \
_APP_STORAGE_LIMIT=100000000 \
_APP_STORAGE_ANTIVIRUS=enabled \
_APP_REDIS_HOST=redis \
_APP_REDIS_PORT=6379 \
_APP_DB_HOST=mariadb \
_APP_DB_PORT=3306 \
_APP_DB_USER=root \
_APP_DB_PASS=password \
_APP_DB_SCHEMA=appwrite \
_APP_INFLUXDB_HOST=influxdb \
_APP_INFLUXDB_PORT=8086 \
_APP_STATSD_HOST=telegraf \
_APP_STATSD_PORT=8125 \
_APP_SMTP_HOST=smtp \
_APP_SMTP_PORT=25 \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION
#ENV _APP_SMTP_SECURE ''
#ENV _APP_SMTP_USERNAME ''
#ENV _APP_SMTP_PASSWORD ''
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests webp certbot htop procps \
libonig-dev libcurl4-gnutls-dev libmagickwand-dev libyaml-dev libbrotli-dev libz-dev
# pecl install imagick yaml && \
# docker-php-ext-enable imagick yaml
RUN docker-php-ext-install sockets curl opcache pdo pdo_mysql
WORKDIR /usr/src/code
COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor
COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/meminfo.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
# Add Source Code
COPY ./app /usr/src/code/app
COPY ./bin /usr/local/bin
COPY ./docs /usr/src/code/docs
COPY ./public /usr/src/code/public
COPY ./src /usr/src/code/src
# Set Volumes
RUN mkdir -p /storage/uploads && \
mkdir -p /storage/cache && \
mkdir -p /storage/config && \
mkdir -p /storage/certificates && \
mkdir -p /storage/functions && \
mkdir -p /storage/debug && \
chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \
chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug
# Executables
RUN chmod +x /usr/local/bin/doctor
RUN chmod +x /usr/local/bin/migrate
RUN chmod +x /usr/local/bin/schedule
RUN chmod +x /usr/local/bin/test
RUN chmod +x /usr/local/bin/worker-audits
RUN chmod +x /usr/local/bin/worker-certificates
RUN chmod +x /usr/local/bin/worker-deletes
RUN chmod +x /usr/local/bin/worker-functions
RUN chmod +x /usr/local/bin/worker-mails
RUN chmod +x /usr/local/bin/worker-tasks
RUN chmod +x /usr/local/bin/worker-usage
RUN chmod +x /usr/local/bin/worker-webhooks
# Letsencrypt Permissions
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
# Enable Extensions
RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini
# RUN echo zend_extension=xdebug.so >> /usr/local/etc/php/conf.d/xdebug.ini
# RUN echo extension=meminfo.so >> /usr/local/etc/php/conf.d/meminfo.ini
RUN echo "opcache.preload_user=www-data" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.enable_cli = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.profiler_enable = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.profiler_output_dir = /tmp/" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.profiler_enable_trigger = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
# RUN echo "xdebug.trace_format = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
EXPOSE 80
#, "-dxdebug.auto_trace=1"
#, "-dxdebug.profiler_enable=1"
#, "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php"
CMD [ "php", "app/server.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
+7 -9
View File
@@ -50,9 +50,8 @@ The easiest way to start running your Appwrite server is by running our docker-c
```bash
docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/install/appwrite:rw \
-e version=0.6.2 \
appwrite/install
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
appwrite/appwrite:0.7.0
```
### Windows
@@ -62,9 +61,8 @@ docker run -it --rm \
```cmd
docker run -it --rm ^
--volume //var/run/docker.sock:/var/run/docker.sock ^
--volume "%cd%"/appwrite:/install/appwrite:rw ^
-e version=0.6.2 ^
appwrite/install
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
appwrite/appwrite:0.7.0
```
#### PowerShell
@@ -72,9 +70,8 @@ docker run -it --rm ^
```powershell
docker run -it --rm ,
--volume /var/run/docker.sock:/var/run/docker.sock ,
--volume ${pwd}/appwrite:/install/appwrite:rw ,
-e version=0.6.2 ,
appwrite/install
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
appwrite/appwrite:0.7.0
```
Once the Docker installation completes, go to http://localhost to access the Appwrite console from your browser. Please note that on non-linux native hosts, the server might take a few minutes to start after installation completes.
@@ -99,6 +96,7 @@ Getting started with Appwrite is as easy as creating a new project, choosing you
* [**Teams**](https://appwrite.io/docs/client/teams) - Manage and group users in teams. Manage memberships, invites, and user roles within a team.
* [**Database**](https://appwrite.io/docs/client/database) - Manage database collections and documents. Read, create, update, and delete documents and filter lists of documents collections using an advanced filter with graph-like capabilities.
* [**Storage**](https://appwrite.io/docs/client/storage) - Manage storage files. Read, create, delete, and preview files. Manipulate the preview of your files to fit your app perfectly. All files are scanned by ClamAV and stored in a secure and encrypted way.
* [**Functions**](https://appwrite.io/docs/server/functions) - Customize your Appwrite server by executing your custom code in an isolate environment, you can trigger your code on any Appwrite system event, manually or using a CRON schedule.
* [**Locale**](https://appwrite.io/docs/client/locale) - Track your user's location, and manage your app locale-based data.
* [**Avatars**](https://appwrite.io/docs/client/avatars) - Manage your users' avatars, countries' flags, browser icons, credit card symbols, and generate QR codes.
+25
View File
@@ -0,0 +1,25 @@
#!/bin/env php
<?php
require_once __DIR__.'/init.php';
use Utopia\App;
use Utopia\CLI\CLI;
use Utopia\CLI\Console;
$cli = new CLI();
include 'tasks/doctor.php';
include 'tasks/install.php';
include 'tasks/migrate.php';
include 'tasks/sdks.php';
include 'tasks/ssl.php';
$cli
->task('version')
->desc('Get the server version')
->action(function () {
Console::log(App::getEnv('_APP_VERSION', 'UNKNOWN'));
});
$cli->run();
+374 -128
View File
File diff suppressed because it is too large Load Diff
+46
View File
@@ -0,0 +1,46 @@
<?php
return [
'node-14' => [
'name' => 'Node.js',
'version' => '14.5',
'base' => 'node:14.5-alpine',
'image' => 'appwrite/env-node:14.5',
'logo' => 'node.png',
],
'php-7.4' => [
'name' => 'PHP',
'version' => '7.4',
'base' => 'php:7.4-cli-alpine',
'image' => 'appwrite/env-php:7.4',
'logo' => 'php.png',
],
'ruby-2.7' => [
'name' => 'Ruby',
'version' => '2.7',
'base' => 'ruby:2.7-alpine',
'image' => 'appwrite/env-ruby:2.7',
'logo' => 'ruby.png',
],
'python-3.8' => [
'name' => 'Python',
'version' => '3.8',
'base' => 'python:3.8-alpine',
'image' => 'appwrite/env-python:3.8',
'logo' => 'python.png',
],
'deno-1.2' => [
'name' => 'Deno',
'version' => '1.2',
'base' => 'hayd/deno:alpine-1.2.0',
'image' => 'appwrite/env-deno:1.2',
'logo' => 'deno.png',
],
// 'dart-2.8' => [
// 'name' => 'Dart',
// 'version' => '2.8',
// 'base' => 'google/dart:2.8',
// 'image' => 'appwrite/env-dart:2.8',
// 'logo' => 'dart.png',
// ],
];

Some files were not shown because too many files have changed in this diff Show More