Skip to content

Commit

Permalink
Merge branch 'production'
Browse files Browse the repository at this point in the history
  • Loading branch information
uniuuu committed Apr 29, 2023
2 parents 03a2dfd + 8ed9484 commit c4d22c7
Show file tree
Hide file tree
Showing 41 changed files with 1,035 additions and 100 deletions.
4 changes: 1 addition & 3 deletions bin/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
set -eux

sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc && ./init-mysql.sh'
#sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc && ./db_update.sh'
#sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc/db-updates/2021-10-16 && php ./0_addMasterGroupHasData'
#sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc/db-updates/2021-10-16 && php ./1_removeMasterGroupTimestampAndVersion'
sudo docker compose exec app-zotprime-dataserver sh -cux 'cd /var/www/zotero/misc && ./db_update.sh'
sudo docker compose exec app-zotprime-dataserver sh -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero'
sudo docker compose exec app-zotprime-dataserver sh -cux 'aws --endpoint-url "http://minio:9000" s3 mb s3://zotero-fulltext'
sudo docker compose exec app-zotprime-dataserver sh -cux 'aws --endpoint-url "http://localstack:4575" sns create-topic --name zotero'
8 changes: 5 additions & 3 deletions client.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ clinet/zotero-standalone-build/dist
clinet/zotero-standalone-build/staging
clinet/zotero-standalone-build/xulrunner
clinet/zotero-standalone-build/pdftools
*.Dockerfile
.github
bin
build
dataserver
doc
docker
docker-compose.yml
README.md
stream-server
tinymce-clean-server
Zend
docker-compose.yml
*.Dockerfile
README.md
zotprime-k8s

3 changes: 2 additions & 1 deletion clientbuildtest.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ build
dataserver
doc
docker
docker-compose.yml
stream-server
tinymce-clean-server
Zend
docker-compose.yml
zotprime-k8s

45 changes: 31 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,62 @@ services:
- MYSQL_PASSWORD=${MYSQLPASSWORD}
volumes:
- dbdata:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
db-zotprime-elasticsearch:
# image: docker.elastic.co/elasticsearch/elasticsearch:5.3.0
image: docker.elastic.co/elasticsearch/elasticsearch:8.7.0
environment:
- cluster.name=zotero
- xpack.security.enabled=false
- cluster.routing.allocation.disk.threshold_enabled=false
image: docker.elastic.co/elasticsearch/elasticsearch:8.7.0
environment:
- cluster.name=zotero
- xpack.security.enabled=false
- cluster.routing.allocation.disk.threshold_enabled=false
# - cluster.routing.allocation.disk.watermark.flood_stage=500mb
- discovery.type=single-node
- discovery.type=single-node
volumes:
- /etc/localtime:/etc/localtime:ro
# privileged: true
#user: root
#command: "sysctl -w vm.max_map_count=262144 && su elasticsearch -c bin/elasticsearch"
# sysctls:
# - vm.max_map_count=262144
# command: "sysctl -w vm.max_map_count=262144"
db-zotprime-redis:
image: redis:5.0
image: redis:5.0
# privileged: true
# user: root
# sysctls:
# - sysctl vm.overcommit_memory=1
volumes:
- /etc/localtime:/etc/localtime:ro
db-zotprime-memcached:
image: memcached:1.5
image: memcached:1.5
volumes:
- /etc/localtime:/etc/localtime:ro
db-zotprime-localstack:
image: atlassianlabs/localstack
environment:
- SERVICES=sns,sqs,apigateway
volumes:
- /etc/localtime:/etc/localtime:ro
db-zotprime-minio:
# image: minio/minio
build:
context: .
dockerfile: minio.Dockerfile
environment:
- MINIO_ACCESS_KEY=zotero
- MINIO_SECRET_KEY=zoterodocker
command: server /data
ports:
- "8082:9000"
volumes:
- /etc/localtime:/etc/localtime:ro
app-zotprime-dataserver:
image: app-zotprime-dataserver
build:
context: .
dockerfile: ds.Dockerfile
ports:
- "8080:80"
# - "8081:81"
- "8082:8082"
# - "8082:8082"
volumes:
- "./dataserver/:/var/www/zotero:rw"
- "./docker/dataserver/config/config.inc.php:/var/www/zotero/include/config/config.inc.php:ro"
Expand All @@ -63,13 +74,14 @@ services:
- "./docker/dataserver/config/header.inc.php:/var/www/zotero/include/header.inc.php:ro"
- "./docker/dataserver/config/Storage.inc.php:/var/www/zotero/model/Storage.inc.php:ro"
- "./docker/dataserver/dbinit/init-mysql.sh:/var/www/zotero/misc/init-mysql.sh:ro"
# - "./docker/dataserver/dbinit/db_update.sh:/var/www/zotero/misc/db_update.sh:ro"
- "./docker/dataserver/dbinit/db_update.sh:/var/www/zotero/misc/db_update.sh:ro"
- "./docker/dataserver/dbinit/www.sql:/var/www/zotero/misc/www.sql:ro"
- "./docker/dataserver/dbinit/shard.sql:/var/www/zotero/misc/shard.sql:ro"
- "./docker/dataserver/config/create-user.sh:/var/www/zotero/admin/create-user.sh:ro"
- /etc/localtime:/etc/localtime:ro
environment:
- RUN_USER=www-data
- RUN_GROUP=www-data
- RUN_USER=apache
- RUN_GROUP=apache
depends_on:
- db-zotprime-mysql
- db-zotprime-elasticsearch
Expand Down Expand Up @@ -99,6 +111,8 @@ services:
- db-zotprime-memcached
links:
- db-zotprime-redis:redis
volumes:
- /etc/localtime:/etc/localtime:ro
restart: always
app-zotprime-streamserver:
image: app-zotprime-streamserver
Expand All @@ -109,6 +123,7 @@ services:
- "8081:81"
volumes:
- "./docker/stream-server/default.js:/usr/src/app/config/default.js:ro"
- /etc/localtime:/etc/localtime:ro
restart: always
depends_on:
- db-zotprime-mysql
Expand All @@ -125,6 +140,8 @@ services:
- PMA_HOST=mysql
links:
- db-zotprime-mysql:mysql
volumes:
- /etc/localtime:/etc/localtime:ro

volumes:
dbdata:
Expand Down
2 changes: 1 addition & 1 deletion docker/dataserver/config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Z_CONFIG {
public static $AWS_REGION = 'us-east-1';
public static $AWS_ACCESS_KEY = 'zotero'; // leave credentials empty to use IAM role
public static $AWS_SECRET_KEY = 'zoterodocker';
public static $S3_ENDPOINT = 'localhost:8082';
public static $S3_ENDPOINT = 'minio:9000';
public static $S3_BUCKET = 'zotero';
public static $S3_BUCKET_CACHE = '';
public static $S3_BUCKET_FULLTEXT = 'zotero-fulltext';
Expand Down
16 changes: 6 additions & 10 deletions docker/dataserver/dbinit/db_update.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#!/usr/bin/env bash
set -xue
#!/bin/sh
set -uex

for i in db-updates/*/; do
cd /var/www/zotero/misc/$i
for j in *; do
find . -type f \( ! -name *.sql \) -exec php {} \;
find . -type f -name *.sql -exec bash -c 'mysql -h mysql -P 3306 -u root -pzotero zotero_master < {}' \;
done
done;
cd ../../
MYSQL="mysql -h mysql -P 3306 -u root -pzotero"
echo "ALTER TABLE libraries ADD hasData TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER version , ADD INDEX ( hasData )" | $MYSQL zotero_master
echo "UPDATE libraries SET hasData=1 WHERE version > 0 OR lastUpdated != '0000-00-00 00:00:00'" | $MYSQL zotero_master
echo "ALTER TABLE libraries DROP COLUMN lastUpdated, DROP COLUMN version" | $MYSQL zotero_master
11 changes: 11 additions & 0 deletions docker/dataserver/dbinit/db_update2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -xue

for i in db-updates/*/; do
cd /var/www/zotero/misc/$i
for j in *; do
find . -type f \( ! -name *.sql \) -exec php {} \;
find . -type f -name *.sql -exec bash -c 'mysql -h mysql -P 3306 -u root -pzotero zotero_master < {}' \;
done
done;
cd ../../
4 changes: 2 additions & 2 deletions docker/dataserver/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export APACHE_LOG_DIR=/var/log/apache2
#/etc/init.d/rsyslog start

# Start rinetd
echo "logfile /dev/stdout" >> /etc/rinetd.conf
rinetd -f -c /etc/rinetd.conf &
#echo "logfile /dev/stdout" >> /etc/rinetd.conf
#rinetd -f -c /etc/rinetd.conf &
#/etc/init.d/rinetd start

#a2enmod headers
Expand Down
Loading

0 comments on commit c4d22c7

Please sign in to comment.