Skip to content

Installation

The latest versions of R Depot are available on our downloads page. R Depot is available for Windows, Mac and Linux.

Docker

The following prerequisites are needed:

  • docker
  • docker-compose (i.e. by issuing pip install docker-compose)
  • port 80 is not used (localhost, check for nginx or apache service)

An example docker-compose YAML file:

version: '3'
services:
  proxy:
    image: library/nginx:alpine
    container_name: oa-rdepot-proxy
    restart: unless-stopped
    volumes:
      - ./docker/proxy/nginx.conf:/etc/nginx/nginx.conf:ro
      - ./docker/proxy/sites-enabled/rdepot:/etc/nginx/sites-enabled/rdepot:ro
      - repository:/opt/rdepot/repo/:ro
    ports:
      - 80:80
    depends_on:
      - app
      - repo
    networks:
      - oa-rdepot
  ldap:
    image: osixia/openldap
    restart: unless-stopped
    hostname: oa-rdepot-ldap
    container_name: oa-rdepot-ldap
    networks:
      - oa-rdepot
    ports:
      - 389:389
      - 636:636
    environment:
      - LDAP_TLS=false
      - LDAP_ORGANISATION=Test Company
      - LDAP_DOMAIN=example.org
      - LDAP_ADMIN_PASSWORD=admin
  db:
    image: library/postgres:alpine
    restart: unless-stopped
    hostname: oa-rdepot-db
    container_name: oa-rdepot-db
    volumes:
      - ./docker/db/rdepot.sql:/docker-entrypoint-initdb.d/rdepot.sql:ro
    networks:
      - oa-rdepot
    environment:
      - POSTGRES_PASSWORD=mysecretpassword
  app:
    image: openanalytics/rdepot-app:1.3.0
    restart: unless-stopped
    hostname: oa-rdepot-app
    container_name: oa-rdepot-app
    ports:
      - 8001:8001
    networks:
      - oa-rdepot
    depends_on:
      - db
    environment:
      - DB_URL=jdbc:postgresql://oa-rdepot-db:5432/postgres
      - DB_USERNAME=postgres
      - LDAP_URL=ldap://oa-rdepot-ldap:389
      - LDAP_BASEDN=dc=example,dc=org
      - LDAP_USEROU=
      - LDAP_LOGINFIELD=cn
      - LDAP_NAMEFIELD=description
      - LDAP_DEFAULT_ADMINS=admin
    healthcheck:
      test: ["CMD-SHELL", "if [ \"$$(curl -I localhost:8080 2>/dev/null | grep HTTP/1.1 | cut -d\" \" -f2)\" != \"302\" ]; then exit 1; else exit 0; fi;"]
      interval: 10s
      timeout: 10s
      retries: 10
  repo:
    image: openanalytics/rdepot-repo:1.3.0
    restart: unless-stopped
    hostname: oa-rdepot-repo
    container_name: oa-rdepot-repo
    volumes:
      - repository:/opt/rdepot/
    networks:
      - oa-rdepot
networks:
  oa-rdepot:
    ipam:
      config:
        - subnet: 192.168.49.0/24
volumes:
  repository:

The missing files (for volume mapping) can be found in our Git repository:

The final step is to launch the Docker containers using docker-compose:

docker-compose up -d

One can then go to http://localhost to log in.

There is an admin user with username admin and password admin.

To complete an end-to-end flow: R package to R Depot to Repository Server to R client, the following steps are needed:

  • create a repository with (or edit)
  • submit one or more packages to that repository via the R Depot web interface
  • publish the repository using the green button in the repositories view (if needed)
  • go to the published package page (repositories view, click repository name, click package name)
  • use the install URL shown on the published package page to install the package in R install.packages("somePackage", repos = c("http://localhost/repo/repositoryName", getOption()))

To (re)start with fresh database:

  • remove the containers via docker-compose down -v
  • start up again using docker-compose up -d

Stand-alone Java applications

Download both rdepot-app-1.3.0-application.war (sha256, md5) and rdepot-repo-1.3.0-application.jar (sha256, md5) and start them by executing java -jar rdepot-app-1.3.0-application.war and java -jar rdepot-repo-1.3.0-application.jar respectively.