2021-09-01 19:05:50 +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
|
|
|
|
2024-02-13 12:09:52 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM node:20.11.0-alpine3.19 as node
|
2021-10-21 17:20:41 +00:00
|
|
|
|
2022-10-26 19:23:02 +00:00
|
|
|
COPY app/console /usr/local/src/console
|
|
|
|
|
|
|
|
|
|
WORKDIR /usr/local/src/console
|
2021-10-21 17:20:41 +00:00
|
|
|
|
2022-11-22 18:59:26 +00:00
|
|
|
ARG VITE_GA_PROJECT
|
2022-11-22 19:32:35 +00:00
|
|
|
ARG VITE_CONSOLE_MODE
|
2023-02-13 14:52:58 +00:00
|
|
|
ARG VITE_APPWRITE_GROWTH_ENDPOINT=https://growth.appwrite.io/v1
|
2022-11-22 19:32:35 +00:00
|
|
|
|
2022-11-22 18:26:41 +00:00
|
|
|
ENV VITE_GA_PROJECT=$VITE_GA_PROJECT
|
2022-11-22 19:32:35 +00:00
|
|
|
ENV VITE_CONSOLE_MODE=$VITE_CONSOLE_MODE
|
2023-02-13 14:18:04 +00:00
|
|
|
ENV VITE_APPWRITE_GROWTH_ENDPOINT=$VITE_APPWRITE_GROWTH_ENDPOINT
|
2022-11-22 18:26:41 +00:00
|
|
|
|
2021-10-21 17:20:41 +00:00
|
|
|
RUN npm ci
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
2024-02-23 11:41:38 +00:00
|
|
|
FROM appwrite/base:0.9.0 as final
|
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 \
|
2021-07-11 12:25:39 +00:00
|
|
|
if [ "$DEBUG" == "true" ]; then \
|
2022-11-09 14:45:20 +00:00
|
|
|
apk add boost boost-dev; \
|
2021-07-10 15:21:46 +00:00
|
|
|
fi
|
|
|
|
|
|
2020-06-26 09:54:37 +00:00
|
|
|
WORKDIR /usr/src/code
|
|
|
|
|
|
2021-09-01 19:05:50 +00:00
|
|
|
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
|
2022-10-26 19:23:02 +00:00
|
|
|
COPY --from=node /usr/local/src/console/build /usr/src/code/console
|
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 ./docs /usr/src/code/docs
|
|
|
|
|
COPY ./src /usr/src/code/src
|
2023-11-06 10:08:11 +00:00
|
|
|
COPY ./dev /usr/src/code/dev
|
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 && \
|
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 && \
|
|
|
|
|
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
|
2019-09-27 14:29:19 +00:00
|
|
|
|
2024-01-09 13:58:45 +00:00
|
|
|
# Development Executables
|
|
|
|
|
RUN chmod +x /usr/local/bin/dev-generate-translations
|
|
|
|
|
|
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 && \
|
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 && \
|
|
|
|
|
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 && \
|
|
|
|
|
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 && \
|
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 && \
|
|
|
|
|
chmod +x /usr/local/bin/worker-functions && \
|
2024-01-11 03:10:20 +00:00
|
|
|
chmod +x /usr/local/bin/worker-hamster && \
|
2022-11-09 14:45:20 +00:00
|
|
|
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 && \
|
2024-01-02 09:49:23 +00:00
|
|
|
chmod +x /usr/local/bin/worker-hamster && \
|
2024-01-28 09:28:59 +00:00
|
|
|
chmod +x /usr/local/bin/worker-usage && \
|
|
|
|
|
chmod +x /usr/local/bin/worker-usage-dump
|
2024-01-02 09:49:23 +00:00
|
|
|
|
2019-05-09 06:54:39 +00:00
|
|
|
|
2023-08-23 10:08:48 +00:00
|
|
|
# Cloud Executabless
|
2024-01-11 03:10:20 +00:00
|
|
|
RUN chmod +x /usr/local/bin/calc-tier-stats && \
|
|
|
|
|
chmod +x /usr/local/bin/calc-users-stats && \
|
|
|
|
|
chmod +x /usr/local/bin/clear-card-cache && \
|
|
|
|
|
chmod +x /usr/local/bin/delete-orphaned-projects && \
|
|
|
|
|
chmod +x /usr/local/bin/get-migration-stats && \
|
|
|
|
|
chmod +x /usr/local/bin/hamster && \
|
|
|
|
|
chmod +x /usr/local/bin/patch-delete-project-collections && \
|
2023-08-23 10:08:48 +00:00
|
|
|
chmod +x /usr/local/bin/patch-delete-schedule-updated-at-attribute && \
|
2023-11-14 13:43:33 +00:00
|
|
|
chmod +x /usr/local/bin/patch-recreate-repositories-documents && \
|
2024-01-24 10:24:59 +00:00
|
|
|
chmod +x /usr/local/bin/volume-sync && \
|
2023-08-23 10:08:48 +00:00
|
|
|
chmod +x /usr/local/bin/patch-delete-project-collections && \
|
2023-10-26 14:45:23 +00:00
|
|
|
chmod +x /usr/local/bin/delete-orphaned-projects && \
|
2023-08-23 10:08:48 +00:00
|
|
|
chmod +x /usr/local/bin/clear-card-cache && \
|
|
|
|
|
chmod +x /usr/local/bin/calc-users-stats && \
|
2023-11-08 09:09:32 +00:00
|
|
|
chmod +x /usr/local/bin/calc-tier-stats && \
|
2023-11-26 08:36:52 +00:00
|
|
|
chmod +x /usr/local/bin/get-migration-stats && \
|
|
|
|
|
chmod +x /usr/local/bin/create-inf-metric
|
2019-05-09 06:54:39 +00:00
|
|
|
|
2020-02-24 16:47:45 +00:00
|
|
|
# Letsencrypt Permissions
|
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
|
|
|
|
2020-06-26 09:54:37 +00:00
|
|
|
# Enable Extensions
|
2023-11-06 10:08:11 +00:00
|
|
|
RUN if [ "$DEBUG" == "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi
|
2023-11-08 11:24:58 +00:00
|
|
|
RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi
|
2023-11-08 11:26:27 +00:00
|
|
|
RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so; 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-02-23 06:34:54 +00:00
|
|
|
CMD [ "php", "app/http.php" ]
|