2024-09-16 09:58:08 +00:00
|
|
|
FROM composer:2.0 AS composer
|
2019-10-06 00:09:19 +00:00
|
|
|
|
|
|
|
|
ARG TESTING=false
|
2020-06-26 09:54:37 +00:00
|
|
|
ENV TESTING=$TESTING
|
|
|
|
|
|
|
|
|
|
WORKDIR /usr/local/src/
|
|
|
|
|
|
|
|
|
|
COPY composer.lock /usr/local/src/
|
|
|
|
|
COPY composer.json /usr/local/src/
|
|
|
|
|
|
2021-12-28 12:37:54 +00:00
|
|
|
RUN composer install --ignore-platform-reqs --optimize-autoloader \
|
2022-11-09 14:45:20 +00:00
|
|
|
--no-plugins --no-scripts --prefer-dist \
|
|
|
|
|
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
|
2020-06-26 09:54:37 +00:00
|
|
|
|
2026-02-05 09:57:21 +00:00
|
|
|
FROM appwrite/base:1.0.0 AS base
|
2019-11-29 07:34:13 +00:00
|
|
|
|
2019-07-31 19:39:31 +00:00
|
|
|
LABEL maintainer="team@appwrite.io"
|
2019-05-09 06:54:39 +00:00
|
|
|
|
2023-08-13 14:20:29 +00:00
|
|
|
ARG VERSION=dev
|
2021-07-11 12:25:39 +00:00
|
|
|
ARG DEBUG=false
|
|
|
|
|
ENV DEBUG=$DEBUG
|
2019-11-29 07:34:13 +00:00
|
|
|
|
2023-09-01 21:17:58 +00:00
|
|
|
ENV _APP_VERSION=$VERSION \
|
|
|
|
|
_APP_HOME=https://appwrite.io
|
2023-08-13 14:20:29 +00:00
|
|
|
|
2021-07-10 15:21:46 +00:00
|
|
|
RUN \
|
2025-12-01 14:18:44 +00:00
|
|
|
if [ "$DEBUG" == "true" ]; then \
|
2022-11-09 14:45:20 +00:00
|
|
|
apk add boost boost-dev; \
|
2025-12-01 14:18:44 +00:00
|
|
|
fi
|
2021-07-10 15:21:46 +00:00
|
|
|
|
2020-06-26 09:54:37 +00:00
|
|
|
WORKDIR /usr/src/code
|
|
|
|
|
|
2024-07-17 18:35:09 +00:00
|
|
|
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
|
|
|
|
|
|
2020-06-26 09:54:37 +00:00
|
|
|
# Add Source Code
|
|
|
|
|
COPY ./app /usr/src/code/app
|
2023-04-29 19:59:11 +00:00
|
|
|
COPY ./public /usr/src/code/public
|
2020-05-21 07:00:06 +00:00
|
|
|
COPY ./bin /usr/local/bin
|
2020-06-26 09:54:37 +00:00
|
|
|
COPY ./src /usr/src/code/src
|
2019-05-09 06:54:39 +00:00
|
|
|
|
2020-06-26 09:54:37 +00:00
|
|
|
# Set Volumes
|
2019-10-06 00:09:19 +00:00
|
|
|
RUN mkdir -p /storage/uploads && \
|
2025-04-14 11:00:05 +00:00
|
|
|
mkdir -p /storage/imports && \
|
2022-11-09 14:45:20 +00:00
|
|
|
mkdir -p /storage/cache && \
|
|
|
|
|
mkdir -p /storage/config && \
|
|
|
|
|
mkdir -p /storage/certificates && \
|
|
|
|
|
mkdir -p /storage/functions && \
|
|
|
|
|
mkdir -p /storage/debug && \
|
2025-08-08 13:16:09 +00:00
|
|
|
chown -Rf www-data:www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
|
|
|
|
|
chown -Rf www-data:www-data /storage/imports && chmod -Rf 0755 /storage/imports && \
|
|
|
|
|
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
|
2019-09-27 14:29:19 +00:00
|
|
|
|
2020-05-21 07:00:06 +00:00
|
|
|
# Executables
|
2020-07-20 22:59:44 +00:00
|
|
|
RUN chmod +x /usr/local/bin/doctor && \
|
2022-11-09 14:45:20 +00:00
|
|
|
chmod +x /usr/local/bin/install && \
|
2025-12-23 11:02:43 +00:00
|
|
|
chmod +x /usr/local/bin/interval && \
|
2024-01-11 03:10:20 +00:00
|
|
|
chmod +x /usr/local/bin/maintenance && \
|
2022-11-09 14:45:20 +00:00
|
|
|
chmod +x /usr/local/bin/migrate && \
|
|
|
|
|
chmod +x /usr/local/bin/realtime && \
|
2024-01-11 03:10:20 +00:00
|
|
|
chmod +x /usr/local/bin/schedule-functions && \
|
2024-06-17 12:44:12 +00:00
|
|
|
chmod +x /usr/local/bin/schedule-executions && \
|
2024-01-11 03:10:20 +00:00
|
|
|
chmod +x /usr/local/bin/schedule-messages && \
|
2022-11-09 14:45:20 +00:00
|
|
|
chmod +x /usr/local/bin/sdks && \
|
|
|
|
|
chmod +x /usr/local/bin/specs && \
|
|
|
|
|
chmod +x /usr/local/bin/ssl && \
|
2025-02-27 14:58:33 +00:00
|
|
|
chmod +x /usr/local/bin/screenshot && \
|
2022-11-09 14:45:20 +00:00
|
|
|
chmod +x /usr/local/bin/test && \
|
2024-01-11 03:10:20 +00:00
|
|
|
chmod +x /usr/local/bin/upgrade && \
|
2022-11-09 14:45:20 +00:00
|
|
|
chmod +x /usr/local/bin/vars && \
|
2024-02-12 01:18:19 +00:00
|
|
|
chmod +x /usr/local/bin/queue-retry && \
|
|
|
|
|
chmod +x /usr/local/bin/queue-count-failed && \
|
|
|
|
|
chmod +x /usr/local/bin/queue-count-processing && \
|
|
|
|
|
chmod +x /usr/local/bin/queue-count-success && \
|
2022-11-09 14:45:20 +00:00
|
|
|
chmod +x /usr/local/bin/worker-audits && \
|
2024-01-11 03:10:20 +00:00
|
|
|
chmod +x /usr/local/bin/worker-builds && \
|
2026-01-08 15:51:04 +00:00
|
|
|
chmod +x /usr/local/bin/worker-screenshots && \
|
2022-11-09 14:45:20 +00:00
|
|
|
chmod +x /usr/local/bin/worker-certificates && \
|
|
|
|
|
chmod +x /usr/local/bin/worker-databases && \
|
|
|
|
|
chmod +x /usr/local/bin/worker-deletes && \
|
2026-02-09 19:24:57 +00:00
|
|
|
chmod +x /usr/local/bin/worker-executions && \
|
2022-11-09 14:45:20 +00:00
|
|
|
chmod +x /usr/local/bin/worker-functions && \
|
|
|
|
|
chmod +x /usr/local/bin/worker-mails && \
|
|
|
|
|
chmod +x /usr/local/bin/worker-messaging && \
|
2023-11-30 21:20:59 +00:00
|
|
|
chmod +x /usr/local/bin/worker-migrations && \
|
2024-01-24 10:24:59 +00:00
|
|
|
chmod +x /usr/local/bin/worker-webhooks && \
|
2025-01-30 04:53:53 +00:00
|
|
|
chmod +x /usr/local/bin/worker-stats-usage && \
|
2025-01-30 04:05:51 +00:00
|
|
|
chmod +x /usr/local/bin/stats-resources && \
|
2025-02-11 07:52:37 +00:00
|
|
|
chmod +x /usr/local/bin/worker-stats-resources
|
2024-01-02 09:49:23 +00:00
|
|
|
|
2020-02-25 08:42:14 +00:00
|
|
|
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
|
2020-02-24 16:47:45 +00:00
|
|
|
|
2025-12-13 11:13:19 +00:00
|
|
|
FROM base AS production
|
|
|
|
|
|
|
|
|
|
RUN rm -rf /usr/src/code/app/config/specs && \
|
|
|
|
|
rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20240924/xdebug.so && \
|
|
|
|
|
find /usr -name '*.a' -delete 2>/dev/null || true && \
|
|
|
|
|
find /usr -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true && \
|
|
|
|
|
find /usr -name '*.pyc' -delete 2>/dev/null || true
|
|
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
|
|
CMD [ "php", "app/http.php" ]
|
|
|
|
|
|
|
|
|
|
FROM base AS development
|
|
|
|
|
|
|
|
|
|
COPY ./docs /usr/src/code/docs
|
|
|
|
|
COPY ./dev /usr/src/code/dev
|
|
|
|
|
|
2025-12-13 13:29:12 +00:00
|
|
|
RUN if [ "$DEBUG" = "true" ]; then \
|
|
|
|
|
cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini && \
|
2025-12-13 11:13:19 +00:00
|
|
|
mkdir -p /tmp/xdebug && \
|
2025-12-13 13:29:12 +00:00
|
|
|
apk add --update --no-cache openssh-client github-cli; \
|
|
|
|
|
fi
|
2020-06-26 09:54:37 +00:00
|
|
|
|
2020-07-02 12:24:39 +00:00
|
|
|
EXPOSE 80
|
2020-06-26 09:54:37 +00:00
|
|
|
|
2024-07-15 18:13:34 +00:00
|
|
|
CMD [ "php", "app/http.php" ]
|