mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #10947 from appwrite/optimize-dockerfile
This commit is contained in:
commit
7d2a95c573
4 changed files with 28 additions and 12 deletions
1
.github/workflows/publish.yml
vendored
1
.github/workflows/publish.yml
vendored
|
|
@ -42,6 +42,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
target: production
|
||||||
build-args: |
|
build-args: |
|
||||||
VERSION=${{ steps.meta.outputs.version }}
|
VERSION=${{ steps.meta.outputs.version }}
|
||||||
VITE_APPWRITE_GROWTH_ENDPOINT=https://growth.appwrite.io/v1
|
VITE_APPWRITE_GROWTH_ENDPOINT=https://growth.appwrite.io/v1
|
||||||
|
|
|
||||||
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
|
|
@ -20,10 +20,10 @@ jobs:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
|
|
@ -46,6 +46,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
target: production
|
||||||
build-args: |
|
build-args: |
|
||||||
VERSION=${{ steps.meta.outputs.version }}
|
VERSION=${{ steps.meta.outputs.version }}
|
||||||
push: true
|
push: true
|
||||||
|
|
|
||||||
33
Dockerfile
33
Dockerfile
|
|
@ -12,7 +12,7 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \
|
||||||
--no-plugins --no-scripts --prefer-dist \
|
--no-plugins --no-scripts --prefer-dist \
|
||||||
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
|
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
|
||||||
|
|
||||||
FROM appwrite/base:0.10.6 AS final
|
FROM appwrite/base:0.10.6 AS base
|
||||||
|
|
||||||
LABEL maintainer="team@appwrite.io"
|
LABEL maintainer="team@appwrite.io"
|
||||||
|
|
||||||
|
|
@ -36,9 +36,7 @@ COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
|
||||||
COPY ./app /usr/src/code/app
|
COPY ./app /usr/src/code/app
|
||||||
COPY ./public /usr/src/code/public
|
COPY ./public /usr/src/code/public
|
||||||
COPY ./bin /usr/local/bin
|
COPY ./bin /usr/local/bin
|
||||||
COPY ./docs /usr/src/code/docs
|
|
||||||
COPY ./src /usr/src/code/src
|
COPY ./src /usr/src/code/src
|
||||||
COPY ./dev /usr/src/code/dev
|
|
||||||
|
|
||||||
# Set Volumes
|
# Set Volumes
|
||||||
RUN mkdir -p /storage/uploads && \
|
RUN mkdir -p /storage/uploads && \
|
||||||
|
|
@ -90,15 +88,30 @@ RUN chmod +x /usr/local/bin/doctor && \
|
||||||
chmod +x /usr/local/bin/stats-resources && \
|
chmod +x /usr/local/bin/stats-resources && \
|
||||||
chmod +x /usr/local/bin/worker-stats-resources
|
chmod +x /usr/local/bin/worker-stats-resources
|
||||||
|
|
||||||
# Letsencrypt Permissions
|
|
||||||
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
|
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
|
||||||
|
|
||||||
# Enable Extensions
|
FROM base AS production
|
||||||
RUN if [ "$DEBUG" = "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi
|
|
||||||
RUN if [ "$DEBUG" = "true" ]; then mkdir -p /tmp/xdebug; fi
|
RUN rm -rf /usr/src/code/app/config/specs && \
|
||||||
RUN if [ "$DEBUG" = "true" ]; then apk add --update --no-cache openssh-client github-cli; fi
|
rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20240924/xdebug.so && \
|
||||||
RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi
|
find /usr -name '*.a' -delete 2>/dev/null || true && \
|
||||||
RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20230831/xdebug.so; fi
|
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
|
||||||
|
|
||||||
|
RUN if [ "$DEBUG" = "true" ]; then \
|
||||||
|
cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini && \
|
||||||
|
mkdir -p /tmp/xdebug && \
|
||||||
|
apk add --update --no-cache openssh-client github-cli; \
|
||||||
|
fi
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ services:
|
||||||
image: appwrite-dev
|
image: appwrite-dev
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
target: development
|
||||||
args:
|
args:
|
||||||
DEBUG: false
|
DEBUG: false
|
||||||
TESTING: true
|
TESTING: true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue