1
0
Fork 0
mirror of synced 2024-05-17 11:12:41 +12:00
appwrite/Dockerfile

141 lines
4.9 KiB
Docker
Raw Permalink Normal View History

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/
RUN composer install --ignore-platform-reqs --optimize-autoloader \
2022-11-10 03:45:20 +13:00
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
2020-06-26 21:54:37 +12:00
2024-02-14 01:09:52 +13:00
FROM --platform=$BUILDPLATFORM node:20.11.0-alpine3.19 as node
2021-10-22 06:20:41 +13:00
2022-10-27 08:23:02 +13:00
COPY app/console /usr/local/src/console
WORKDIR /usr/local/src/console
2021-10-22 06:20:41 +13:00
ARG VITE_GA_PROJECT
2022-11-23 08:32:35 +13:00
ARG VITE_CONSOLE_MODE
2023-02-14 03:52:58 +13:00
ARG VITE_APPWRITE_GROWTH_ENDPOINT=https://growth.appwrite.io/v1
2022-11-23 08:32:35 +13:00
2022-11-23 07:26:41 +13:00
ENV VITE_GA_PROJECT=$VITE_GA_PROJECT
2022-11-23 08:32:35 +13:00
ENV VITE_CONSOLE_MODE=$VITE_CONSOLE_MODE
2023-02-14 03:18:04 +13:00
ENV VITE_APPWRITE_GROWTH_ENDPOINT=$VITE_APPWRITE_GROWTH_ENDPOINT
2022-11-23 07:26:41 +13:00
2021-10-22 06:20:41 +13:00
RUN npm ci
RUN npm run build
2024-02-24 00:41:38 +13:00
FROM appwrite/base:0.9.0 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
2023-08-14 02:20:29 +12: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
2023-09-02 09:17:58 +12:00
ENV _APP_VERSION=$VERSION \
_APP_HOME=https://appwrite.io
2023-08-14 02:20:29 +12:00
RUN \
2021-07-12 00:25:39 +12:00
if [ "$DEBUG" == "true" ]; then \
2022-11-10 03:45:20 +13:00
apk add boost boost-dev; \
fi
2020-06-26 21:54:37 +12:00
WORKDIR /usr/src/code
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
2022-10-27 08:23:02 +13:00
COPY --from=node /usr/local/src/console/build /usr/src/code/console
2020-06-26 21:54:37 +12:00
# Add Source Code
COPY ./app /usr/src/code/app
COPY ./public /usr/src/code/public
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
COPY ./src /usr/src/code/src
2023-11-06 23:08:11 +13:00
COPY ./dev /usr/src/code/dev
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 && \
2022-11-10 03:45:20 +13: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-28 02:29:19 +12:00
2024-01-10 02:58:45 +13:00
# Development Executables
RUN chmod +x /usr/local/bin/dev-generate-translations
2020-05-21 19:00:06 +12:00
# Executables
2020-07-21 10:59:44 +12:00
RUN chmod +x /usr/local/bin/doctor && \
2022-11-10 03:45:20 +13:00
chmod +x /usr/local/bin/install && \
2024-01-11 16:10:20 +13:00
chmod +x /usr/local/bin/maintenance && \
2022-11-10 03:45:20 +13:00
chmod +x /usr/local/bin/migrate && \
chmod +x /usr/local/bin/realtime && \
2024-01-11 16:10:20 +13:00
chmod +x /usr/local/bin/schedule-functions && \
chmod +x /usr/local/bin/schedule-messages && \
2022-11-10 03:45:20 +13: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 16:10:20 +13:00
chmod +x /usr/local/bin/upgrade && \
2022-11-10 03:45:20 +13:00
chmod +x /usr/local/bin/vars && \
2024-02-12 14:18:19 +13: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-10 03:45:20 +13:00
chmod +x /usr/local/bin/worker-audits && \
2024-01-11 16:10:20 +13:00
chmod +x /usr/local/bin/worker-builds && \
2022-11-10 03:45:20 +13: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 16:10:20 +13:00
chmod +x /usr/local/bin/worker-hamster && \
2022-11-10 03:45:20 +13:00
chmod +x /usr/local/bin/worker-mails && \
chmod +x /usr/local/bin/worker-messaging && \
chmod +x /usr/local/bin/worker-migrations && \
chmod +x /usr/local/bin/worker-webhooks && \
chmod +x /usr/local/bin/worker-hamster && \
2024-01-28 22:28:59 +13:00
chmod +x /usr/local/bin/worker-usage && \
chmod +x /usr/local/bin/worker-usage-dump
2019-05-09 18:54:39 +12:00
2023-08-23 22:08:48 +12:00
# Cloud Executabless
2024-01-11 16:10:20 +13: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 22:08:48 +12:00
chmod +x /usr/local/bin/patch-delete-schedule-updated-at-attribute && \
chmod +x /usr/local/bin/patch-recreate-repositories-documents && \
chmod +x /usr/local/bin/volume-sync && \
2023-08-23 22:08:48 +12:00
chmod +x /usr/local/bin/patch-delete-project-collections && \
2023-10-27 03:45:23 +13:00
chmod +x /usr/local/bin/delete-orphaned-projects && \
2023-08-23 22:08:48 +12:00
chmod +x /usr/local/bin/clear-card-cache && \
chmod +x /usr/local/bin/calc-users-stats && \
2023-11-08 22:09:32 +13:00
chmod +x /usr/local/bin/calc-tier-stats && \
2023-11-26 21:36:52 +13:00
chmod +x /usr/local/bin/get-migration-stats && \
chmod +x /usr/local/bin/create-inf-metric
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
2023-11-06 23:08:11 +13:00
RUN if [ "$DEBUG" == "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi
RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi
2023-11-09 00:26:27 +13:00
RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so; fi
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
2024-02-23 19:34:54 +13:00
CMD [ "php", "app/http.php" ]