Skip to content

Commit

Permalink
fix: Added elasticsearch RAM limit
Browse files Browse the repository at this point in the history
    feat: copy dataserver during image buid and do not mount as a volume
    Reference minio/minio#5469   fix storage bugs   (cherry picked from commit 404ded2)
    patch: k8s objects for tinymceclean, streamserver, redis, localstack, phpmyadmin, elasticsearch, memcached, mariadb, minio
    fix: fix docker compose CI
    fix: fix .gitignore
    feat: Added 1. dev, prod docker compose. 2. docker compose build CI workflow. 3. pre-built images configuration
  • Loading branch information
uniuuu committed May 16, 2023
1 parent 7b7dec8 commit 6bae761
Show file tree
Hide file tree
Showing 91 changed files with 1,991 additions and 192 deletions.
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**/secret.json
**/secret.txt
**/secret.yaml
.git
.github
.env
bin
build
doc
docker-compose.yml
logs
Zend
zotprime-k8s

7 changes: 0 additions & 7 deletions .env

This file was deleted.

13 changes: 13 additions & 0 deletions .env_example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#Version
VER=2.5.0-beta

## SPECIFY SECRETS
#DB
MYSQLROOTPASSWORD=strongpassword
MYSQLDATABASE=aotprimeprod
MYSQLUSER=zotprimeprod
MYSQLPASSWORD=strongpassword

#MINIO
MINIOROOTUSER=zotero
MINIOROOTPASSWORD=strongpassword
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.env
build
logs
logs
**/secret.json
**/secret.txt
**/secret.yaml
docker-compose.yml
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ $ cd zotprime

*Configure and run*:
```bash
$ cp .env_example .env
$ cp docker-compose-prod.yml docker-compose.yml
```
edit .env and add strong passwords
```bash
$ sudo docker compose up -d
```

Expand Down
2 changes: 2 additions & 0 deletions client.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

FROM node:16-alpine as intermediate
ARG ZOTPRIME_VERSION=2

RUN set -eux; \
apk update && apk upgrade && \
apk add --update --no-cache git bash curl python3 zip perl rsync \
Expand Down
4 changes: 4 additions & 0 deletions client.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ clinet/zotero-standalone-build/dist
clinet/zotero-standalone-build/staging
clinet/zotero-standalone-build/xulrunner
clinet/zotero-standalone-build/pdftools
**/secret.json
**/secret.txt
**/secret.yaml
.env
*.Dockerfile
.github
bin
Expand Down
1 change: 1 addition & 0 deletions clientbuildtest.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

FROM node:16-alpine as intermediate
ARG ZOTPRIME_VERSION=2

RUN set -eux; \
apk update && apk upgrade && \
Expand Down
4 changes: 4 additions & 0 deletions clientbuildtest.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**/secret.json
**/secret.txt
**/secret.yaml
.env
.github
bin
build
Expand Down
6 changes: 6 additions & 0 deletions db.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

############################
# mariadb image
############################

FROM mariadb:10
19 changes: 19 additions & 0 deletions db.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
**/secret.json
**/secret.txt
**/secret.yaml
.git
.github
.env
bin
build
client
dataserver
doc
docker
docker-compose.yml
logs
stream-server
tinymce-clean-server
Zend
zotprime-k8s

90 changes: 54 additions & 36 deletions docker-compose.yml → docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
version: '3.9'
services:
zotprime-db:
image: mariadb:10
image: "zotprime-db:${VER}"
# image: mysql:5.6
build:
context: .
dockerfile: db.Dockerfile
restart: always
# command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=${MYSQLROOTPASSWORD}
- MYSQL_DATABASE=${MYSQLDATABASE}
- MYSQL_USER=${MYSQLUSER}
- MYSQL_PASSWORD=${MYSQLPASSWORD}
- MARIADB_ROOT_PASSWORD=${MYSQLROOTPASSWORD}
- MARIADB_DATABASE=${MYSQLDATABASE}
- MARIADB_USER=${MYSQLUSER}
- MARIADB_PASSWORD=${MYSQLPASSWORD}
volumes:
- dbdata:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
Expand All @@ -18,14 +21,19 @@ services:
# soft: 262144
# hard: 262144
zotprime-elasticsearch:
# image: docker.elastic.co/elasticsearch/elasticsearch:5.3.0
image: docker.elastic.co/elasticsearch/elasticsearch:8.7.0
image: "zotprime-elasticsearch:${VER}"
mem_limit: 512m
mem_reservation: 256M
build:
context: .
dockerfile: es.Dockerfile
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
# - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
volumes:
- /etc/localtime:/etc/localtime:ro
# privileged: true
Expand All @@ -35,44 +43,51 @@ services:
# - vm.max_map_count=262144
# command: "sysctl -w vm.max_map_count=262144"
zotprime-redis:
image: redis:5.0
image: "zotprime-redis:${VER}"
build:
context: .
dockerfile: r.Dockerfile
# privileged: true
# user: root
# sysctls:
# - sysctl vm.overcommit_memory=1
volumes:
- /etc/localtime:/etc/localtime:ro
zotprime-memcached:
image: memcached:1.5
image: "zotprime-memcached:${VER}"
build:
context: .
dockerfile: m.Dockerfile
volumes:
- /etc/localtime:/etc/localtime:ro
zotprime-localstack:
image: atlassianlabs/localstack
image: "zotprime-localstack:${VER}"
build:
context: .
dockerfile: ls.Dockerfile
environment:
- SERVICES=sns,sqs,apigateway
volumes:
- /etc/localtime:/etc/localtime:ro
zotprime-minio:
# image: minio/minio:RELEASE.2018-10-25T01-27-03Z
# image: minio/minio:RELEASE.2019-01-31T00-31-19Z
# image: minio/minio:RELEASE.2021-06-14T01-29-23Z
# image: minio/minio:RELEASE.2021-10-02T16-31-05Z
image: minio/minio
image: "zotprime-minio:${VER}"
build:
context: .
dockerfile: minio.Dockerfile
environment:
# - MINIO_ACCESS_KEY=zotero
# - MINIO_SECRET_KEY=zoterodocker
# - MINIO_HTTP_TRACE=/dev/stderr
- MINIO_ROOT_USER=${MINIOROOTUSER}
- MINIO_ROOT_PASSWORD=${MINIOROOTPASSWORD}
# command: server /data
command: server /data --console-address ":9001"
ports:
# - "8082:9000"
- "9001:9001"
volumes:
- /etc/localtime:/etc/localtime:ro
zotprime-miniomc:
image: minio/mc
image: "zotprime-miniomc:${VER}"
build:
context: .
dockerfile: miniomc.Dockerfile
# entrypoint:
# - /bin/sh
entrypoint: >
Expand All @@ -86,7 +101,7 @@ services:
depends_on:
- zotprime-minio
zotprime-dataserver:
image: zotprime-dataserver
image: "zotprime-dataserver:${VER}"
build:
context: .
dockerfile: ds.Dockerfile
Expand All @@ -98,18 +113,18 @@ services:
- "8082:8082"
# - "9000:9000"
volumes:
- "./dataserver/:/var/www/zotero:rw"
- "./Zend/:/var/www/zotero/include/Zend:rw"
- "./docker/dataserver/create-user.sh:/var/www/zotero/admin/create-user.sh:ro"
- "./docker/dataserver/config.inc.php:/var/www/zotero/include/config/config.inc.php:ro"
- "./docker/dataserver/dbconnect.inc.php:/var/www/zotero/include/config/dbconnect.inc.php:ro"
- "./docker/dataserver/header.inc.php:/var/www/zotero/include/header.inc.php:ro"
- "./docker/dataserver/Storage.inc.php:/var/www/zotero/model/Storage.inc.php:ro"
# - "./docker/dataserver/config/FullText.inc.php:/var/www/zotero/model/FullText.inc.php:ro" # DEBUG
- "./docker/db/init-mysql.sh:/var/www/zotero/misc/init-mysql.sh:ro"
- "./docker/db/db_update.sh:/var/www/zotero/misc/db_update.sh:ro"
- "./docker/db/www.sql:/var/www/zotero/misc/www.sql:ro"
- "./docker/db/shard.sql:/var/www/zotero/misc/shard.sql:ro"
# - "./dataserver/:/var/www/zotero:rw"
# - "./Zend/:/var/www/zotero/include/Zend:rw"
# - "./docker/dataserver/create-user.sh:/var/www/zotero/admin/create-user.sh:ro"
# - "./docker/dataserver/config.inc.php:/var/www/zotero/include/config/config.inc.php:ro"
# - "./docker/dataserver/dbconnect.inc.php:/var/www/zotero/include/config/dbconnect.inc.php:ro"
# - "./docker/dataserver/header.inc.php:/var/www/zotero/include/header.inc.php:ro"
# - "./docker/dataserver/Storage.inc.php:/var/www/zotero/model/Storage.inc.php:ro"
# - "./docker/dataserver/config/FullText.inc.php:/var/www/zotero/model/FullText.inc.php:ro"
# - "./docker/db/init-mysql.sh:/var/www/zotero/misc/init-mysql.sh:ro"
# - "./docker/db/db_update.sh:/var/www/zotero/misc/db_update.sh:ro"
# - "./docker/db/www.sql:/var/www/zotero/misc/www.sql:ro"
# - "./docker/db/shard.sql:/var/www/zotero/misc/shard.sql:ro"
- "/etc/localtime:/etc/localtime:ro"
environment:
- RUN_USER=apache
Expand All @@ -132,7 +147,7 @@ services:
- zotprime-streamserver:streamserver
restart: always
zotprime-tinymceclean:
image: zotprime-tinymceclean
image: "zotprime-tinymceclean:${VER}"
build:
context: .
dockerfile: tmcs.Dockerfile
Expand All @@ -147,7 +162,7 @@ services:
- /etc/localtime:/etc/localtime:ro
restart: always
zotprime-streamserver:
image: zotprime-streamserver
image: "zotprime-streamserver:${VER}"
build:
context: .
dockerfile: sts.Dockerfile
Expand All @@ -165,7 +180,10 @@ services:
links:
- zotprime-redis:redis
zotprime-phpmyadmin:
image: phpmyadmin/phpmyadmin
image: "zotprime-phpmyadmin:${VER}"
build:
context: .
dockerfile: pa.Dockerfile
ports:
- "8083:80"
environment:
Expand Down
Loading

0 comments on commit 6bae761

Please sign in to comment.