0
0
Fork 0
mirror of https://github.com/verdigado/groupfolder_tags.git synced 2024-12-06 11:42:42 +01:00

init gitpod

This commit is contained in:
Jonathan Treffler 2024-07-31 09:37:01 +00:00
parent 3f7e80f5de
commit 17092d8e73
6 changed files with 163 additions and 0 deletions

37
.gitpod.yml Normal file
View file

@ -0,0 +1,37 @@
tasks:
- name: Nextcloud Server
init: |
cd gitpod
git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/nextcloud/server.git server
docker-compose up --no-start
command: |
git config core.fileMode false
# Both gitpod and Nextcloud need read/write acess
# Obviously not recommended for a production system
sudo chown -R www-data:www-data ${GITPOD_REPO_ROOT}
sudo chmod -R 777 ${GITPOD_REPO_ROOT}
cd gitpod
docker-compose up
- name: Dependency install & Frontend watch
init: make dev-setup
command: make watch-js
- name: Terminal
command: clear
ports:
- port: 8080
onOpen: notify
visibility: private
- port: 8081
visibility: private
onOpen: ignore
vscode:
extensions:
- Vue.volar
- dbaeumer.vscode-eslint
- ms-azuretools.vscode-docker
- zobo.php-intellisense

61
gitpod/docker-compose.yml Normal file
View file

@ -0,0 +1,61 @@
# This is for gitpod, DO NOT USE THIS TO HOST YOUR PRODUCTION NEXTCLOUD
version: '2'
volumes:
nextcloud:
db:
config:
services:
db:
image: mariadb
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb_read_only_compressed=OFF
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=wdGq73jQB0p373gLdf6yLRj5
- MYSQL_PASSWORD=wdGq73jQB0p373gLdf6yLRj5
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
phpmyadmin:
image: phpmyadmin
container_name: phpmyadmin
links:
- db
volumes:
- /phpmyadminapache2logs/:/var/log/apache2/
environment:
PMA_HOST: db
PMA_PORT: 3306
restart: always
ports:
- 8081:80
app:
image: 'local/nextcloud'
build:
context: ./nextcloud
dockerfile: Dockerfile
restart: always
ports:
- 8080:80
links:
- db
volumes:
- nextcloud:/var/www/html
- config:/var/www/html/config
- /workspace/groupfolder_tags/:/var/www/html/custom_apps/groupfolder_tags/
- /apache2logs/:/var/log/apache2/
environment:
- MYSQL_PASSWORD=wdGq73jQB0p373gLdf6yLRj5
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
- NEXTCLOUD_ADMIN_USER=dev
- NEXTCLOUD_ADMIN_PASSWORD=t2qQ1C6ktYUv7
- NEXTCLOUD_TRUSTED_DOMAINS=*.gitpod.io
- OVERWRITEPROTOCOL=https
- NEXTCLOUD_UPDATE=1

View file

@ -0,0 +1,15 @@
FROM nextcloud
RUN apt-get update && apt-get install -y --no-install-recommends jq
COPY custom-entrypoint.sh /custom-entrypoint.sh
COPY after-install.sh /after-install.sh
RUN chmod +x /custom-entrypoint.sh
RUN chmod +x /after-install.sh
RUN echo "opcache.revalidate_freq=0" > /usr/local/etc/php/conf.d/z-gitpod.ini
ENTRYPOINT ["/custom-entrypoint.sh"]
CMD ["/after-install.sh"]

View file

@ -0,0 +1,37 @@
#!/bin/bash
run_as() {
if [ "$(id -u)" = 0 ]; then
su -p www-data -s /bin/sh -c "$1"
else
sh -c "$1"
fi
}
is_installed() {
echo "$(run_as 'php /var/www/html/occ status --output=json' | jq '.installed')"
}
wait_until_finished() {
until [[ $(is_installed) == "true" ]]; do
echo "waiting for nextcloud to initialize, so groupfolder_tags can be activated"
run_as "php /var/www/html/occ status --output=json"
sleep 5
done
}
echo "$(is_installed)"
wait_until_finished
run_as "php /var/www/html/occ config:system:set debug --value='true' --type=boolean"
run_as "php /var/www/html/occ app:enable groupfolder_tags"
run_as "php /var/www/html/occ migrations:migrate groupfolder_tags"
run_as "php /var/www/html/occ app:disable firstrunwizard"
run_as "php /var/www/html/occ config:system:set defaultapp --value='groupfolder_tags'"
apache2-foreground

View file

@ -0,0 +1,8 @@
#!/bin/bash
# Both gitpod and Nextcloud need read/write acess
# Obviously not recommended for a production system
chown -R www-data:www-data /var/www/html/custom_apps/
chmod -R 777 /var/www/html/custom_apps/
/entrypoint.sh "$@"

5
gitpod/reset.sh Normal file
View file

@ -0,0 +1,5 @@
#!/bin/bash
docker-compose down
docker volume rm gitpod_config gitpod_db gitpod_nextcloud
docker-compose up --force-recreate --build