generated from coop-cloud/example
Take a run at bootstrapping this
This commit is contained in:
parent
ff6f96fc76
commit
0b7873871a
|
@ -1,6 +1,6 @@
|
||||||
TYPE=rstudio
|
TYPE=rstudio
|
||||||
|
|
||||||
DOMAIN=rstudio.example.com
|
DOMAIN=rstudio.example.com
|
||||||
## Domain aliases
|
|
||||||
#EXTRA_DOMAINS=', `www.rstudio.example.com`'
|
|
||||||
LETS_ENCRYPT_ENV=production
|
LETS_ENCRYPT_ENV=production
|
||||||
|
|
||||||
|
SECRET_ADMIN_PASSWORD_VERSION=v1
|
||||||
|
|
26
README.md
26
README.md
|
@ -1,16 +1,22 @@
|
||||||
# Rstudio
|
# rstudio
|
||||||
|
|
||||||
An integrated development environment for R and Python, with a console, syntax-highlighting editor that supports direct code execution, and tools for plotting, history, debugging and workspace management.
|
> https://www.rocker-project.org/images
|
||||||
|
|
||||||
|
An integrated development environment for R and Python, with a console,
|
||||||
|
syntax-highlighting editor that supports direct code execution, and tools for
|
||||||
|
plotting, history, debugging and workspace management.
|
||||||
|
|
||||||
<!-- metadata -->
|
<!-- metadata -->
|
||||||
* **Category**:
|
|
||||||
* **Status**:
|
- **Category**:
|
||||||
* **Image**: [`rstudio`](https://hub.docker.com/r/rstudio/rstudio)
|
- **Status**:
|
||||||
* **Healthcheck**:
|
- **Image**: [`rocker/tidyverse`](https://hub.docker.com/r/rocker/tidyverse)
|
||||||
* **Backups**:
|
- **Healthcheck**:
|
||||||
* **Email**:
|
- **Backups**:
|
||||||
* **Tests**:
|
- **Email**:
|
||||||
* **SSO**:
|
- **Tests**:
|
||||||
|
- **SSO**:
|
||||||
|
|
||||||
<!-- endmetadata -->
|
<!-- endmetadata -->
|
||||||
|
|
||||||
## Basic usage
|
## Basic usage
|
||||||
|
|
41
compose.yml
41
compose.yml
|
@ -3,29 +3,54 @@ version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: nginx:1.19.2
|
image: rocker/tidyverse:4.0.4
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
|
volumes:
|
||||||
|
- home:/home
|
||||||
|
secrets:
|
||||||
|
- admin_password
|
||||||
|
environment:
|
||||||
|
- ROOT=TRUE
|
||||||
|
- PASSWORD_FILE=/run/secrets/admin_password
|
||||||
|
configs:
|
||||||
|
- source: custom_entrypoint
|
||||||
|
target: /usr/local/bin/docker-entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
entrypoint: /usr/local/bin/docker-entrypoint.sh
|
||||||
|
command: /init
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8787"
|
||||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
|
||||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||||
## Redirect from EXTRA_DOMAINS to DOMAIN
|
entrypoint:
|
||||||
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
|
||||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
|
||||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost"]
|
test:
|
||||||
|
["CMD-SHELL", "wget -q --spider --proxy=off localhost:8787 || exit 1"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
start_period: 1m
|
start_period: 1m
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
home:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
|
configs:
|
||||||
|
custom_entrypoint:
|
||||||
|
name: ${STACK_NAME}_custom_entrypoint_${CUSTOM_ENTRYPOINT_VERSION}
|
||||||
|
file: entrypoint.sh.tmpl
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
admin_password:
|
||||||
|
name: ${STACK_NAME}_admin_password_${SECRET_ADMIN_PASSWORD_VERSION}
|
||||||
|
external: true
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
file_env() {
|
||||||
|
local var="$1"
|
||||||
|
local fileVar="${var}_FILE"
|
||||||
|
local def="${2:-}"
|
||||||
|
|
||||||
|
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
||||||
|
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local val="$def"
|
||||||
|
|
||||||
|
if [ "${!var:-}" ]; then
|
||||||
|
val="${!var}"
|
||||||
|
elif [ "${!fileVar:-}" ]; then
|
||||||
|
val="$(< "${!fileVar}")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export "$var"="$val"
|
||||||
|
unset "$fileVar"
|
||||||
|
}
|
||||||
|
|
||||||
|
file_env "PASSWORD"
|
Loading…
Reference in New Issue