mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 23:38:06 +02:00
Sibling containers, controlled from RC file
This commit is contained in:
parent
07522ea5f5
commit
153835464a
4 changed files with 26 additions and 30 deletions
|
@ -85,5 +85,3 @@ Run `git pull`, and check out the latest tag. (TODO: improve this).
|
|||
|
||||
- In `overleaf.rc` set `SIBLING_CONTAINERS_ENABLED=true`
|
||||
- In `overleaf.rc`, ensure `DOCKER_SOCKET_PATH` is set
|
||||
- In `variables.env`, un-comment the block starting with `DOCKER_RUNNER=...`,
|
||||
and set the appropriate values
|
||||
|
|
|
@ -18,15 +18,6 @@ function __main__() {
|
|||
awk '{print "RC_" $0}' # prefix with 'RC_'
|
||||
)
|
||||
|
||||
if [[ "${RC_DEBUG:-null}" != "null" ]]; then
|
||||
echo ">>>>>>VARS>>>>>>"
|
||||
echo "$(set -o posix; set | grep ^RC_)"
|
||||
echo "IMAGE_VERSION=$SHARELATEX_IMAGE_VERSION"
|
||||
echo "MONGO_IMAGE=$MONGO_IMAGE"
|
||||
echo "REDIS_IMAGE=$REDIS_IMAGE"
|
||||
echo "<<<<<<<<<<<<<<<<"
|
||||
fi
|
||||
|
||||
# Select which docker-compose files to load
|
||||
compose_file_flags=("-f ./lib/docker-compose.base.yml")
|
||||
if [[ "$RC_REDIS_ENABLED" == "true" ]]; then
|
||||
|
@ -47,14 +38,6 @@ function __main__() {
|
|||
# Build up the flags to pass to docker-compose
|
||||
project_name="${RC_PROJECT_NAME:-overleaf}"
|
||||
|
||||
if [[ "${RC_DEBUG:-null}" != "null" ]]; then
|
||||
echo ">>>>COMPOSE-ARGS>>>>"
|
||||
echo "-p $project_name"
|
||||
echo "${compose_file_flags[@]}"
|
||||
echo "$@"
|
||||
echo "<<<<<<<<<<<<<<<<<<<<"
|
||||
fi
|
||||
|
||||
image_name="sharelatex/sharelatex"
|
||||
if [[ "${RC_SERVER_PRO:-null}" == "true" ]]; then
|
||||
image_name="quay.io/sharelatex/sharelatex-pro"
|
||||
|
@ -62,6 +45,26 @@ function __main__() {
|
|||
|
||||
full_image_spec="$image_name:$SHARELATEX_IMAGE_VERSION"
|
||||
|
||||
# Canonicalize data paths
|
||||
RC_SHARELATEX_DATA_PATH=$(cd config; realpath "$RC_SHARELATEX_DATA_PATH")
|
||||
RC_MONGO_DATA_PATH=$(cd config; realpath "$RC_MONGO_DATA_PATH")
|
||||
RC_REDIS_DATA_PATH=$(cd config; realpath "$RC_REDIS_DATA_PATH")
|
||||
|
||||
# Print debug info
|
||||
if [[ "${RC_DEBUG:-null}" != "null" ]]; then
|
||||
echo ">>>>>>VARS>>>>>>"
|
||||
echo "$(set -o posix; set | grep ^RC_)"
|
||||
echo "IMAGE_VERSION=$SHARELATEX_IMAGE_VERSION"
|
||||
echo "MONGO_IMAGE=$MONGO_IMAGE"
|
||||
echo "REDIS_IMAGE=$REDIS_IMAGE"
|
||||
echo "<<<<<<<<<<<<<<<<"
|
||||
echo ">>>>COMPOSE-ARGS>>>>"
|
||||
echo "-p $project_name"
|
||||
echo "${compose_file_flags[@]}"
|
||||
echo "$@"
|
||||
echo "<<<<<<<<<<<<<<<<<<<<"
|
||||
fi
|
||||
|
||||
# Export vars for use in docker-compose files
|
||||
export RC_IMAGE="$full_image_spec"
|
||||
export RC_SHARELATEX_DATA_PATH
|
||||
|
|
|
@ -4,3 +4,9 @@ services:
|
|||
sharelatex:
|
||||
volumes:
|
||||
- "${RC_DOCKER_SOCKET_PATH}:/var/run/docker.sock"
|
||||
environment:
|
||||
DOCKER_RUNNER: 'true'
|
||||
SANDBOXED_COMPILES: 'true'
|
||||
SANDBOXED_COMPILES_SIBLING_CONTAINERS: 'true'
|
||||
SANDBOXED_COMPILES_HOST_DIR: "${RC_SHARELATEX_DATA_PATH}/data/compiles"
|
||||
SYNCTEX_BIN_HOST_PATH: "${RC_SHARELATEX_DATA_PATH}/bin/synctex"
|
||||
|
|
|
@ -48,17 +48,6 @@ TEXMFVAR=/var/lib/sharelatex/tmp/texmf-var
|
|||
## Server Pro ##
|
||||
################
|
||||
|
||||
### Sibling Containers:
|
||||
### Uncomment the following block when enabling sibling containers
|
||||
### and replace 'path-to-data-directory' with full SHARELATEX_DATA_PATH
|
||||
|
||||
# DOCKER_RUNNER=true
|
||||
# SANDBOXED_COMPILES=true
|
||||
# SANDBOXED_COMPILES_SIBLING_CONTAINERS=true
|
||||
# SANDBOXED_COMPILES_HOST_DIR=path-to-data-directory/sharelatex/data/compiles
|
||||
# SYNCTEX_BIN_HOST_PATH=path-to-data-directory/sharelatex/bin/synctex
|
||||
|
||||
|
||||
## Works with test LDAP server shown at bottom of docker compose
|
||||
# SHARELATEX_LDAP_URL=ldap://ldap:389
|
||||
# SHARELATEX_LDAP_SEARCH_BASE=ou=people,dc=planetexpress,dc=com
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue