2021-09-02 07:05:50 +12:00
|
|
|
FROM composer:2.0 as composer
|
2019-10-06 13:09:19 +13:00
|
|
|
|
|
|
|
ARG TESTING=false
|
2020-06-26 21:54:37 +12:00
|
|
|
ENV TESTING=$TESTING
|
|
|
|
|
|
|
|
WORKDIR /usr/local/src/
|
|
|
|
|
|
|
|
COPY composer.lock /usr/local/src/
|
|
|
|
COPY composer.json /usr/local/src/
|
|
|
|
|
2021-12-29 01:37:54 +13:00
|
|
|
RUN composer install --ignore-platform-reqs --optimize-autoloader \
|
2020-06-26 21:54:37 +12:00
|
|
|
--no-plugins --no-scripts --prefer-dist \
|
|
|
|
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
|
|
|
|
|
2022-04-21 02:55:37 +12:00
|
|
|
FROM node:16.14.2-alpine3.15 as node
|
2021-10-22 06:20:41 +13:00
|
|
|
|
|
|
|
WORKDIR /usr/local/src/
|
|
|
|
|
|
|
|
COPY package-lock.json /usr/local/src/
|
|
|
|
COPY package.json /usr/local/src/
|
|
|
|
COPY gulpfile.js /usr/local/src/
|
|
|
|
COPY public /usr/local/src/public
|
|
|
|
|
|
|
|
RUN npm ci
|
|
|
|
RUN npm run build
|
|
|
|
|
2022-04-20 02:01:59 +12:00
|
|
|
FROM php:8.0.18-cli-alpine3.15 as compile
|
2019-10-06 13:09:19 +13:00
|
|
|
|
2021-07-12 00:25:39 +12:00
|
|
|
ARG DEBUG=false
|
|
|
|
ENV DEBUG=$DEBUG
|
2021-07-11 03:21:46 +12:00
|
|
|
|
2022-03-02 06:55:36 +13:00
|
|
|
ENV PHP_REDIS_VERSION=5.3.7 \
|
2022-04-21 02:55:37 +12:00
|
|
|
PHP_MONGODB_VERSION=1.13.0 \
|
2022-06-28 00:16:35 +12:00
|
|
|
PHP_SWOOLE_VERSION=v4.8.10 \
|
2022-01-16 19:33:47 +13:00
|
|
|
PHP_IMAGICK_VERSION=3.7.0 \
|
2021-12-16 02:18:55 +13:00
|
|
|
PHP_YAML_VERSION=2.2.2 \
|
2022-08-31 14:09:08 +12:00
|
|
|
PHP_MAXMINDDB_VERSION=v1.11.0 \
|
2022-10-17 00:42:00 +13:00
|
|
|
PHP_MEMCACHED_VERSION=v3.2.0 \
|
2022-08-31 21:45:47 +12:00
|
|
|
PHP_ZSTD_VERSION="4504e4186e79b197cfcb75d4d09aa47ef7d92fe9 "
|
2019-10-06 13:09:19 +13:00
|
|
|
|
|
|
|
RUN \
|
2020-07-21 05:16:26 +12:00
|
|
|
apk add --no-cache --virtual .deps \
|
2020-07-21 03:40:12 +12:00
|
|
|
make \
|
|
|
|
automake \
|
|
|
|
autoconf \
|
|
|
|
gcc \
|
|
|
|
g++ \
|
|
|
|
git \
|
2020-07-21 05:16:26 +12:00
|
|
|
zlib-dev \
|
2020-10-25 09:45:15 +13:00
|
|
|
brotli-dev \
|
2021-05-05 03:21:10 +12:00
|
|
|
openssl-dev \
|
2020-10-27 19:20:52 +13:00
|
|
|
yaml-dev \
|
|
|
|
imagemagick \
|
|
|
|
imagemagick-dev \
|
2022-08-31 14:09:08 +12:00
|
|
|
libmaxminddb-dev \
|
2022-10-17 00:42:00 +13:00
|
|
|
libmemcached-dev \
|
2022-08-31 14:09:08 +12:00
|
|
|
zstd-dev
|
2020-07-21 03:40:12 +12:00
|
|
|
|
2020-06-26 21:54:37 +12:00
|
|
|
RUN docker-php-ext-install sockets
|
|
|
|
|
2021-09-02 07:05:50 +12:00
|
|
|
FROM compile AS redis
|
2020-06-26 21:54:37 +12:00
|
|
|
RUN \
|
2019-11-29 20:34:13 +13:00
|
|
|
# Redis Extension
|
2021-04-09 22:54:50 +12:00
|
|
|
git clone --depth 1 --branch $PHP_REDIS_VERSION https://github.com/phpredis/phpredis.git && \
|
2020-10-27 19:12:00 +13:00
|
|
|
cd phpredis && \
|
2020-06-26 21:54:37 +12:00
|
|
|
phpize && \
|
2019-10-06 13:09:19 +13:00
|
|
|
./configure && \
|
2021-09-02 07:05:50 +12:00
|
|
|
make && make install
|
|
|
|
|
|
|
|
## Swoole Extension
|
|
|
|
FROM compile AS swoole
|
|
|
|
RUN \
|
2021-04-09 22:54:50 +12:00
|
|
|
git clone --depth 1 --branch $PHP_SWOOLE_VERSION https://github.com/swoole/swoole-src.git && \
|
2020-06-26 21:54:37 +12:00
|
|
|
cd swoole-src && \
|
|
|
|
phpize && \
|
2021-03-11 09:27:50 +13:00
|
|
|
./configure --enable-sockets --enable-http2 --enable-openssl && \
|
2020-07-05 06:21:07 +12:00
|
|
|
make && make install && \
|
2021-09-02 07:05:50 +12:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
## Swoole Debugger setup
|
|
|
|
RUN if [ "$DEBUG" == "true" ]; then \
|
|
|
|
cd /tmp && \
|
|
|
|
apk add boost-dev && \
|
|
|
|
git clone --depth 1 https://github.com/swoole/yasd && \
|
|
|
|
cd yasd && \
|
|
|
|
phpize && \
|
|
|
|
./configure && \
|
|
|
|
make && make install && \
|
|
|
|
cd ..;\
|
|
|
|
fi
|
|
|
|
|
|
|
|
## Imagick Extension
|
|
|
|
FROM compile AS imagick
|
|
|
|
RUN \
|
2021-06-30 02:59:32 +12:00
|
|
|
git clone --depth 1 --branch $PHP_IMAGICK_VERSION https://github.com/imagick/imagick && \
|
2020-10-27 19:20:52 +13:00
|
|
|
cd imagick && \
|
|
|
|
phpize && \
|
|
|
|
./configure && \
|
2021-09-02 07:05:50 +12:00
|
|
|
make && make install
|
|
|
|
|
|
|
|
## YAML Extension
|
|
|
|
FROM compile AS yaml
|
|
|
|
RUN \
|
2021-04-09 22:54:50 +12:00
|
|
|
git clone --depth 1 --branch $PHP_YAML_VERSION https://github.com/php/pecl-file_formats-yaml && \
|
2020-10-27 19:20:52 +13:00
|
|
|
cd pecl-file_formats-yaml && \
|
|
|
|
phpize && \
|
|
|
|
./configure && \
|
2021-09-02 07:05:50 +12:00
|
|
|
make && make install
|
|
|
|
|
|
|
|
## Maxminddb extension
|
|
|
|
FROM compile AS maxmind
|
|
|
|
RUN \
|
2021-04-09 22:54:50 +12:00
|
|
|
git clone --depth 1 --branch $PHP_MAXMINDDB_VERSION https://github.com/maxmind/MaxMind-DB-Reader-php.git && \
|
2020-10-27 19:12:00 +13:00
|
|
|
cd MaxMind-DB-Reader-php && \
|
|
|
|
cd ext && \
|
2020-10-25 09:45:15 +13:00
|
|
|
phpize && \
|
|
|
|
./configure && \
|
2021-09-02 07:05:50 +12:00
|
|
|
make && make install
|
2020-07-21 03:40:12 +12:00
|
|
|
|
2021-09-30 23:32:10 +13:00
|
|
|
# Mongodb Extension
|
|
|
|
FROM compile as mongodb
|
|
|
|
RUN \
|
|
|
|
git clone --depth 1 --branch $PHP_MONGODB_VERSION https://github.com/mongodb/mongo-php-driver.git && \
|
|
|
|
cd mongo-php-driver && \
|
|
|
|
git submodule update --init && \
|
|
|
|
phpize && \
|
|
|
|
./configure && \
|
|
|
|
make && make install
|
2021-07-11 03:21:46 +12:00
|
|
|
|
2022-10-17 00:42:00 +13:00
|
|
|
# Memcached Extension
|
|
|
|
FROM compile as memcached
|
|
|
|
RUN \
|
|
|
|
git clone --depth 1 --branch $PHP_MEMCACHED_VERSION https://github.com/php-memcached-dev/php-memcached.git && \
|
|
|
|
cd php-memcached && \
|
|
|
|
phpize && \
|
|
|
|
./configure && \
|
|
|
|
make && make install
|
|
|
|
|
2022-08-31 14:09:08 +12:00
|
|
|
# Zstd Compression
|
|
|
|
FROM compile as zstd
|
2022-09-01 01:21:52 +12:00
|
|
|
RUN git clone --recursive -n https://github.com/kjdev/php-ext-zstd.git \
|
2022-08-31 14:09:08 +12:00
|
|
|
&& cd php-ext-zstd \
|
2022-09-01 01:21:52 +12:00
|
|
|
&& git checkout $PHP_ZSTD_VERSION \
|
2022-08-31 14:09:08 +12:00
|
|
|
&& phpize \
|
|
|
|
&& ./configure --with-libzstd \
|
|
|
|
&& make && make install
|
|
|
|
|
2022-06-24 04:16:12 +12:00
|
|
|
# Rust Extensions Compile Image
|
|
|
|
FROM php:8.0.18-cli as rust_compile
|
|
|
|
|
|
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
|
|
|
|
|
|
ENV PATH=/root/.cargo/bin:$PATH
|
|
|
|
|
2022-06-28 22:48:15 +12:00
|
|
|
RUN apt-get update && apt-get install musl-tools build-essential clang-11 git -y
|
2022-06-24 04:16:12 +12:00
|
|
|
RUN rustup target add $(uname -m)-unknown-linux-musl
|
|
|
|
|
|
|
|
# Install ZigBuild for easier cross-compilation
|
|
|
|
RUN curl https://ziglang.org/builds/zig-linux-$(uname -m)-0.10.0-dev.2674+d980c6a38.tar.xz --output /tmp/zig.tar.xz
|
2022-06-24 23:24:13 +12:00
|
|
|
RUN tar -xf /tmp/zig.tar.xz -C /tmp/ && cp -r /tmp/zig-linux-$(uname -m)-0.10.0-dev.2674+d980c6a38 /tmp/zig/
|
2022-06-24 04:16:12 +12:00
|
|
|
ENV PATH=/tmp/zig:$PATH
|
|
|
|
RUN cargo install cargo-zigbuild
|
|
|
|
ENV RUSTFLAGS="-C target-feature=-crt-static"
|
|
|
|
|
|
|
|
FROM rust_compile as scrypt
|
|
|
|
|
|
|
|
WORKDIR /usr/local/lib/php/extensions/
|
|
|
|
|
|
|
|
RUN \
|
2022-07-26 03:51:18 +12:00
|
|
|
git clone --depth 1 https://github.com/appwrite/php-scrypt.git && \
|
|
|
|
cd php-scrypt && \
|
2022-06-24 04:16:12 +12:00
|
|
|
cargo zigbuild --workspace --all-targets --target $(uname -m)-unknown-linux-musl --release && \
|
2022-07-26 03:51:18 +12:00
|
|
|
mv target/$(uname -m)-unknown-linux-musl/release/libphp_scrypt.so target/libphp_scrypt.so
|
2022-06-24 04:16:12 +12:00
|
|
|
|
2022-04-20 02:10:16 +12:00
|
|
|
FROM php:8.0.18-cli-alpine3.15 as final
|
2019-11-29 20:34:13 +13:00
|
|
|
|
2019-08-01 07:39:31 +12:00
|
|
|
LABEL maintainer="team@appwrite.io"
|
2019-05-09 18:54:39 +12:00
|
|
|
|
2019-11-29 20:34:13 +13:00
|
|
|
ARG VERSION=dev
|
2021-07-12 00:25:39 +12:00
|
|
|
ARG DEBUG=false
|
|
|
|
ENV DEBUG=$DEBUG
|
2019-11-29 20:34:13 +13:00
|
|
|
|
2022-06-09 23:38:38 +12:00
|
|
|
ENV DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
|
2022-06-10 23:37:39 +12:00
|
|
|
ENV DOCKER_COMPOSE_VERSION=v2.5.0
|
2019-11-29 20:34:13 +13:00
|
|
|
|
2020-10-28 06:24:18 +13:00
|
|
|
ENV _APP_SERVER=swoole \
|
2019-10-06 13:09:19 +13:00
|
|
|
_APP_ENV=production \
|
2021-04-04 13:30:41 +12:00
|
|
|
_APP_LOCALE=en \
|
2022-03-01 00:05:11 +13:00
|
|
|
_APP_WORKER_PER_CORE= \
|
2020-03-01 19:33:19 +13:00
|
|
|
_APP_DOMAIN=localhost \
|
|
|
|
_APP_DOMAIN_TARGET=localhost \
|
2019-10-06 13:09:19 +13:00
|
|
|
_APP_HOME=https://appwrite.io \
|
|
|
|
_APP_EDITION=community \
|
2021-05-13 02:53:25 +12:00
|
|
|
_APP_CONSOLE_WHITELIST_ROOT=enabled \
|
2021-02-24 00:29:12 +13:00
|
|
|
_APP_CONSOLE_WHITELIST_EMAILS= \
|
|
|
|
_APP_CONSOLE_WHITELIST_IPS= \
|
|
|
|
_APP_SYSTEM_EMAIL_NAME= \
|
|
|
|
_APP_SYSTEM_EMAIL_ADDRESS= \
|
|
|
|
_APP_SYSTEM_RESPONSE_FORMAT= \
|
|
|
|
_APP_SYSTEM_SECURITY_EMAIL_ADDRESS= \
|
2019-10-06 13:09:19 +13:00
|
|
|
_APP_OPTIONS_ABUSE=enabled \
|
2020-06-02 07:58:58 +12:00
|
|
|
_APP_OPTIONS_FORCE_HTTPS=disabled \
|
2019-10-06 13:09:19 +13:00
|
|
|
_APP_OPENSSL_KEY_V1=your-secret-key \
|
2020-10-28 08:56:37 +13:00
|
|
|
_APP_STORAGE_LIMIT=10000000 \
|
2020-05-26 01:12:59 +12:00
|
|
|
_APP_STORAGE_ANTIVIRUS=enabled \
|
2021-01-03 08:45:59 +13:00
|
|
|
_APP_STORAGE_ANTIVIRUS_HOST=clamav \
|
|
|
|
_APP_STORAGE_ANTIVIRUS_PORT=3310 \
|
2022-11-17 19:36:41 +13:00
|
|
|
_APP_CONNECTIONS_STORAGE= \
|
2019-10-06 13:09:19 +13:00
|
|
|
_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 \
|
2021-02-23 00:54:05 +13:00
|
|
|
_APP_SMTP_HOST= \
|
|
|
|
_APP_SMTP_PORT= \
|
|
|
|
_APP_SMTP_SECURE= \
|
|
|
|
_APP_SMTP_USERNAME= \
|
|
|
|
_APP_SMTP_PASSWORD= \
|
2022-08-15 01:43:41 +12:00
|
|
|
_APP_SMS_PROVIDER= \
|
|
|
|
_APP_SMS_FROM= \
|
2022-02-23 21:04:44 +13:00
|
|
|
_APP_FUNCTIONS_SIZE_LIMIT=30000000 \
|
2020-07-20 02:42:46 +12:00
|
|
|
_APP_FUNCTIONS_TIMEOUT=900 \
|
2020-12-15 07:04:57 +13:00
|
|
|
_APP_FUNCTIONS_CPUS=1 \
|
|
|
|
_APP_FUNCTIONS_MEMORY=128 \
|
2021-09-22 22:08:02 +12:00
|
|
|
_APP_EXECUTOR_SECRET=a-random-secret \
|
2022-11-10 22:37:49 +13:00
|
|
|
_APP_EXECUTOR_HOST=http://exc1/v1 \
|
2020-02-04 21:06:13 +13:00
|
|
|
_APP_SETUP=self-hosted \
|
2020-12-15 05:39:44 +13:00
|
|
|
_APP_VERSION=$VERSION \
|
2021-01-13 00:56:40 +13:00
|
|
|
_APP_USAGE_STATS=enabled \
|
2022-08-09 17:29:24 +12:00
|
|
|
_APP_USAGE_TIMESERIES_INTERVAL=30 \
|
|
|
|
_APP_USAGE_DATABASE_INTERVAL=900 \
|
2021-01-21 04:28:52 +13:00
|
|
|
# 14 Days = 1209600 s
|
2021-01-21 07:23:48 +13:00
|
|
|
_APP_MAINTENANCE_RETENTION_EXECUTION=1209600 \
|
|
|
|
_APP_MAINTENANCE_RETENTION_AUDIT=1209600 \
|
2020-12-23 01:57:22 +13:00
|
|
|
# 1 Day = 86400 s
|
2021-01-21 07:23:48 +13:00
|
|
|
_APP_MAINTENANCE_RETENTION_ABUSE=86400 \
|
2021-11-23 05:12:18 +13:00
|
|
|
_APP_MAINTENANCE_INTERVAL=86400 \
|
|
|
|
_APP_LOGGING_PROVIDER= \
|
2021-11-24 22:38:32 +13:00
|
|
|
_APP_LOGGING_CONFIG=
|
2019-08-10 23:38:09 +12:00
|
|
|
|
2019-05-09 18:54:39 +12:00
|
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
|
|
|
|
RUN \
|
2020-07-21 10:59:44 +12:00
|
|
|
apk update \
|
|
|
|
&& apk add --no-cache --virtual .deps \
|
2020-07-21 03:40:12 +12:00
|
|
|
make \
|
|
|
|
automake \
|
|
|
|
autoconf \
|
|
|
|
gcc \
|
|
|
|
g++ \
|
2020-07-21 10:59:44 +12:00
|
|
|
curl-dev \
|
|
|
|
&& apk add --no-cache \
|
|
|
|
libstdc++ \
|
2020-10-27 19:20:52 +13:00
|
|
|
certbot \
|
2022-11-03 03:56:03 +13:00
|
|
|
rsync \
|
2020-10-27 19:20:52 +13:00
|
|
|
brotli-dev \
|
2020-07-21 10:59:44 +12:00
|
|
|
yaml-dev \
|
2020-07-21 05:34:48 +12:00
|
|
|
imagemagick \
|
2021-06-30 02:59:32 +12:00
|
|
|
imagemagick-dev \
|
2020-10-29 11:34:21 +13:00
|
|
|
libmaxminddb-dev \
|
2020-07-21 10:59:44 +12:00
|
|
|
certbot \
|
|
|
|
docker-cli \
|
2021-06-30 02:59:32 +12:00
|
|
|
libgomp \
|
2020-07-21 08:05:36 +12:00
|
|
|
&& docker-php-ext-install sockets opcache pdo_mysql \
|
2020-10-13 21:51:41 +13:00
|
|
|
&& apk del .deps \
|
|
|
|
&& rm -rf /var/cache/apk/*
|
2020-06-26 21:54:37 +12:00
|
|
|
|
2022-06-09 23:38:38 +12:00
|
|
|
RUN \
|
|
|
|
mkdir -p $DOCKER_CONFIG/cli-plugins \
|
2022-06-28 01:57:24 +12:00
|
|
|
&& ARCH=$(uname -m) && if [ $ARCH == "armv7l" ]; then ARCH="armv7"; fi \
|
2022-06-10 23:37:39 +12:00
|
|
|
&& curl -SL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-linux-$ARCH -o $DOCKER_CONFIG/cli-plugins/docker-compose \
|
2022-06-09 23:38:38 +12:00
|
|
|
&& chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
|
|
|
|
|
2021-07-11 03:21:46 +12:00
|
|
|
RUN \
|
2021-07-12 00:25:39 +12:00
|
|
|
if [ "$DEBUG" == "true" ]; then \
|
2021-07-11 03:21:46 +12:00
|
|
|
apk add boost boost-dev; \
|
|
|
|
fi
|
|
|
|
|
2020-06-26 21:54:37 +12:00
|
|
|
WORKDIR /usr/src/code
|
|
|
|
|
2021-09-02 07:05:50 +12:00
|
|
|
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
|
2021-10-22 06:20:41 +13:00
|
|
|
COPY --from=node /usr/local/src/public/dist /usr/src/code/public/dist
|
2021-09-02 07:05:50 +12:00
|
|
|
COPY --from=swoole /usr/local/lib/php/extensions/no-debug-non-zts-20200930/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yasd.so* /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
|
|
|
COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20200930/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
|
|
|
COPY --from=imagick /usr/local/lib/php/extensions/no-debug-non-zts-20200930/imagick.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
|
|
|
COPY --from=yaml /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yaml.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
|
|
|
COPY --from=maxmind /usr/local/lib/php/extensions/no-debug-non-zts-20200930/maxminddb.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
2021-09-30 23:32:10 +13:00
|
|
|
COPY --from=mongodb /usr/local/lib/php/extensions/no-debug-non-zts-20200930/mongodb.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
2022-10-17 00:42:00 +13:00
|
|
|
COPY --from=memcached /usr/local/lib/php/extensions/no-debug-non-zts-20200930/memcached.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
2022-07-26 03:51:18 +12:00
|
|
|
COPY --from=scrypt /usr/local/lib/php/extensions/php-scrypt/target/libphp_scrypt.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
2022-08-31 14:09:08 +12:00
|
|
|
COPY --from=zstd /usr/local/lib/php/extensions/no-debug-non-zts-20200930/zstd.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
2020-06-26 21:54:37 +12:00
|
|
|
|
|
|
|
# Add Source Code
|
|
|
|
COPY ./app /usr/src/code/app
|
2020-05-21 19:00:06 +12:00
|
|
|
COPY ./bin /usr/local/bin
|
2020-06-26 21:54:37 +12:00
|
|
|
COPY ./docs /usr/src/code/docs
|
2021-10-22 06:20:41 +13:00
|
|
|
COPY ./public/fonts /usr/src/code/public/fonts
|
|
|
|
COPY ./public/images /usr/src/code/public/images
|
2020-06-26 21:54:37 +12:00
|
|
|
COPY ./src /usr/src/code/src
|
2019-05-09 18:54:39 +12:00
|
|
|
|
2020-06-26 21:54:37 +12:00
|
|
|
# Set Volumes
|
2019-10-06 13:09:19 +13:00
|
|
|
RUN mkdir -p /storage/uploads && \
|
|
|
|
mkdir -p /storage/cache && \
|
2020-05-01 22:24:36 +12:00
|
|
|
mkdir -p /storage/config && \
|
|
|
|
mkdir -p /storage/certificates && \
|
2020-07-15 09:20:46 +12:00
|
|
|
mkdir -p /storage/functions && \
|
2020-07-05 06:21:07 +12:00
|
|
|
mkdir -p /storage/debug && \
|
2019-10-06 13:09:19 +13:00
|
|
|
chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
|
2020-05-01 22:24:36 +12:00
|
|
|
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 && \
|
2020-07-05 06:21:07 +12:00
|
|
|
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
|
2020-07-15 09:20:46 +12:00
|
|
|
chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \
|
2020-07-05 06:21:07 +12:00
|
|
|
chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug
|
2019-09-28 02:29:19 +12:00
|
|
|
|
2020-05-21 19:00:06 +12:00
|
|
|
# Executables
|
2020-07-21 10:59:44 +12:00
|
|
|
RUN chmod +x /usr/local/bin/doctor && \
|
2020-12-15 05:39:44 +13:00
|
|
|
chmod +x /usr/local/bin/maintenance && \
|
2022-11-03 04:08:13 +13:00
|
|
|
chmod +x /usr/local/bin/volume-sync && \
|
2021-08-11 17:44:08 +12:00
|
|
|
chmod +x /usr/local/bin/usage && \
|
2020-07-29 07:48:51 +12:00
|
|
|
chmod +x /usr/local/bin/install && \
|
2020-07-21 10:59:44 +12:00
|
|
|
chmod +x /usr/local/bin/migrate && \
|
2020-10-16 20:31:09 +13:00
|
|
|
chmod +x /usr/local/bin/realtime && \
|
2020-07-21 10:59:44 +12:00
|
|
|
chmod +x /usr/local/bin/schedule && \
|
2020-10-29 23:58:48 +13:00
|
|
|
chmod +x /usr/local/bin/sdks && \
|
2022-01-02 01:07:11 +13:00
|
|
|
chmod +x /usr/local/bin/specs && \
|
2020-07-29 07:48:51 +12:00
|
|
|
chmod +x /usr/local/bin/ssl && \
|
2020-07-21 10:59:44 +12:00
|
|
|
chmod +x /usr/local/bin/test && \
|
2020-10-15 18:03:38 +13:00
|
|
|
chmod +x /usr/local/bin/vars && \
|
2020-07-21 10:59:44 +12:00
|
|
|
chmod +x /usr/local/bin/worker-audits && \
|
|
|
|
chmod +x /usr/local/bin/worker-certificates && \
|
2022-06-22 22:51:49 +12:00
|
|
|
chmod +x /usr/local/bin/worker-databases && \
|
2020-07-21 10:59:44 +12:00
|
|
|
chmod +x /usr/local/bin/worker-deletes && \
|
|
|
|
chmod +x /usr/local/bin/worker-functions && \
|
2022-01-24 11:25:46 +13:00
|
|
|
chmod +x /usr/local/bin/worker-builds && \
|
2020-07-21 10:59:44 +12:00
|
|
|
chmod +x /usr/local/bin/worker-mails && \
|
2022-06-09 01:57:34 +12:00
|
|
|
chmod +x /usr/local/bin/worker-messaging && \
|
2022-02-25 03:18:46 +13:00
|
|
|
chmod +x /usr/local/bin/worker-webhooks
|
2019-05-09 18:54:39 +12:00
|
|
|
|
2020-02-25 05:47:45 +13:00
|
|
|
# Letsencrypt Permissions
|
2020-02-25 21:42:14 +13:00
|
|
|
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
|
2020-02-25 05:47:45 +13:00
|
|
|
|
2020-06-26 21:54:37 +12:00
|
|
|
# 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
|
2020-10-27 19:20:52 +13:00
|
|
|
RUN echo extension=imagick.so >> /usr/local/etc/php/conf.d/imagick.ini
|
|
|
|
RUN echo extension=yaml.so >> /usr/local/etc/php/conf.d/yaml.ini
|
2020-10-25 09:45:15 +13:00
|
|
|
RUN echo extension=maxminddb.so >> /usr/local/etc/php/conf.d/maxminddb.ini
|
2022-07-26 03:51:18 +12:00
|
|
|
RUN echo extension=libphp_scrypt.so >> /usr/local/etc/php/conf.d/libphp_scrypt.ini
|
2022-08-31 15:26:21 +12:00
|
|
|
RUN echo extension=zstd.so >> /usr/local/etc/php/conf.d/zstd.ini
|
2021-07-12 00:25:39 +12:00
|
|
|
RUN if [ "$DEBUG" == "true" ]; then printf "zend_extension=yasd \nyasd.debug_mode=remote \nyasd.init_file=/usr/local/dev/yasd_init.php \nyasd.remote_port=9005 \nyasd.log_level=-1" >> /usr/local/etc/php/conf.d/yasd.ini; fi
|
2020-07-05 06:21:07 +12:00
|
|
|
|
2021-07-12 00:25:39 +12:00
|
|
|
RUN if [ "$DEBUG" == "true" ]; then echo "opcache.enable=0" >> /usr/local/etc/php/conf.d/appwrite.ini; fi
|
2020-07-05 06:21:07 +12:00
|
|
|
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
|
2020-10-28 08:56:37 +13:00
|
|
|
RUN echo "opcache.enable_cli=1" >> /usr/local/etc/php/conf.d/appwrite.ini
|
2020-11-01 03:59:00 +13:00
|
|
|
RUN echo "default_socket_timeout=-1" >> /usr/local/etc/php/conf.d/appwrite.ini
|
2020-10-27 19:20:52 +13:00
|
|
|
RUN echo "opcache.jit_buffer_size=100M" >> /usr/local/etc/php/conf.d/appwrite.ini
|
|
|
|
RUN echo "opcache.jit=1235" >> /usr/local/etc/php/conf.d/appwrite.ini
|
2020-06-26 21:54:37 +12:00
|
|
|
|
2020-07-03 00:24:39 +12:00
|
|
|
EXPOSE 80
|
2020-06-26 21:54:37 +12:00
|
|
|
|
2020-07-28 05:15:36 +12:00
|
|
|
CMD [ "php", "app/http.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
|