Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinicius Reis <vinicius.reis@nextcloud.com>2022-06-06 17:36:32 +0300
committerVinicius Reis <vinicius.reis@nextcloud.com>2022-06-06 17:36:32 +0300
commit4c2540d14d063764542cb9dff3805d9a15de4b2f (patch)
tree3ae8253ee5d9c31ce7a7c5a1289fadf705bc5294 /cypress
parentbb49e3c248eb1f0cb5f3e13a315c3eee0369e9a1 (diff)
🐛 (#2481): improve image build performance and fix apps permissions
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/Dockerfile55
-rw-r--r--cypress/server.sh3
2 files changed, 43 insertions, 15 deletions
diff --git a/cypress/Dockerfile b/cypress/Dockerfile
index d095ecd53..ca343d110 100644
--- a/cypress/Dockerfile
+++ b/cypress/Dockerfile
@@ -1,17 +1,46 @@
-FROM nextcloud:latest
+FROM nextcloud:latest as source
+
+WORKDIR /tmp
RUN set -ex; \
apt-get update; \
- apt-get install -y --no-install-recommends git; \
- git clone https://github.com/nextcloud/server.git ; \
- git clone https://github.com/nextcloud/viewer server/apps/viewer; \
+ apt-get install -y --no-install-recommends git;
+
+RUN set -ex; \
+ git clone --depth 1 https://github.com/nextcloud/server.git ; \
+ git clone --depth 1 https://github.com/nextcloud/viewer server/apps/viewer;
+
+RUN set -ex; \
cd server; \
- git submodule update --init; \
- mkdir data; \
- chown -R www-data:www-data config data apps custom_apps; \
- cd ..; \
- cp -R /usr/src/nextcloud/config server/ ; \
- rm -rf /usr/src/nextcloud; \
- mv server /usr/src/nextcloud; \
- apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false git; \
- rm -rf /var/lib/apt/lists/*
+ git submodule update --init;
+
+RUN cp -r -v /usr/src/nextcloud/config /tmp/server
+
+FROM nextcloud:latest
+
+RUN set -ex; \
+ rm -rf /usr/src/nextcloud;
+
+COPY --from=source --chown=www-data:www-data /tmp/server /usr/src/nextcloud
+COPY --chown=www-data:www-data ./server.sh /tmp/server.sh
+
+RUN set -ex; \
+ cd /usr/src/nextcloud; \
+ mkdir data; \
+ mkdir custom_apps; \
+ chown -R www-data:www-data config data apps custom_apps;
+
+ENV NEXTCLOUD_ADMIN_PASSWORD=admin
+ENV NEXTCLOUD_ADMIN_USER=admin
+ENV SQLITE_DATABASE=sqlite_db
+
+RUN set -ex; \
+ cd /var/www/html; \
+ NEXTCLOUD_UPDATE=1 bash -x /entrypoint.sh pwd; \
+ chown -R www-data:www-data config data apps custom_apps; \
+ bash -x /tmp/server.sh; \
+ rm -rf /var/www/html/apps/text
+
+RUN set -ex; \
+ cd /var/www/html; \
+ ls -lah
diff --git a/cypress/server.sh b/cypress/server.sh
index 83fcec453..24f215d63 100644
--- a/cypress/server.sh
+++ b/cypress/server.sh
@@ -1,7 +1,6 @@
#!/bin/bash
su -s /bin/bash www-data -c "
-php /var/www/html/occ maintenance:install --database \
- 'sqlite' --admin-user 'admin' --admin-pass 'admin'
+php /var/www/html/occ config:system:set debug --value='true' --type=boolean
export OC_PASS=1234561
php /var/www/html/occ user:add --password-from-env user1
php /var/www/html/occ user:add --password-from-env user2