Docker

The docker setup described below is only valid for UNIX based systems. If you are working on a Windows machine please consult other manuals on how to setup a docker environment and run docker images under Windows.

To build a custom docker container, please download the VC Publisher Linux Installation file. In the zip file the used dockerfile and start script are included.

System requirements

Before the VC Publisher image can be launched, docker must be installed on your system.

Update

Skip this step if you are installing the VC Publisher for the first time!

This section is intended for users who wish to upgrade an existing 5.3 installation of the VC Publisher to version 6.

  • Do a backup of your data!: Backup the database and other relevant files, see chapter Backup data below.

  • Update: If you want to upgrade from a version older than v5.3, please contact <support@vc.systems>. For all upgrade paths do a backup of your data first and then install the newer VC Publisher:

  1. Load newest docker image of the VC Publisher

  2. Delete the old container as described in the Uninstall section below

  3. Start new docker image referencing to previously used data and database folders as described in step 6 of the Installation section below

Installation

  1. Unzip the downloaded zip file from the download page.

  2. Load image:

    docker load -i vcPUBLISHER.tar.gz
  3. For persistent installations, create local data folders for docker internal mount points. Otherwise the data will just be stored inside the container. The VC Publisher docker container can have three mount points or volumes:

    1. /vcs/data: VC Publisher public and private folders will be created here, e.g. /home/user/data/

    2. /vcs/database: MongoDB database files will be persisted here, e.g. /home/user/database/

  4. Create a user:group for the internal VC Publisher user, on which the container runs with that user:

    sudo groupadd -g 1005 vcpublisher
    sudo useradd -g 1005 -u 1005 vcpublisher
  5. Change the owner of the created folders to that user:group to set access permission for the internal VC Publisher user:

    sudo chown -R vcpublisher:vcpublisher /home/user/database
    sudo chown -R vcpublisher:vcpublisher /home/user/data
  6. Start container with the following command:

    docker run --user 1005:1005 \
    -e "ROOT_URL=http://localhost:3333" \
    -e "VCS_INITIAL_USER=admin" \
    -e "VCS_INITIAL_PASSWORD=admin123" \
    --name publisher \
    -p 3333:3000 \
    -v /home/user/database:/vcs/database \
    -v /home/user/data:/vcs/data \
    publisher:$VERSION
    1. ROOT_URL: internal URL where the VC Publisher can be accessed

    2. VCS_INITIAL_USER: initial user for the VC Publisher

    3. VCS_INITIAL_PASSWORD: password for the initial user

    4. --name: Name of the docker container to be created

    5. -p externalPort:3000: on which external port the internal docker port (3000, must not be changed) should be mapped to (here port 3333)

    6. -v local/folder/path/:/vcs/path/: to which local folders the internal docker paths should be mapped to (internal vcs paths are /vcs/data/ and /vcs/database/, these must not be renamed), /vcs/database/ is only needed if the internal database is used and no MONGO_URL is given.

    7. $VERSION: Version of the used VC Publisher image (e.g. v6.0.0). The version of the docker image to be installed can be found in the file description (vcPUBLISHER-DockerImage-$VERSION-$BUILD.tar.gz).

  1. To run the container on port 80 use -p 80:3000 and change the port in ROOT_URL (“ROOT_URL=http://localhost:80”)

  2. To run the container permanently add --restart always so that the container will restart automatically on server restart

  3. To use an external MongoDB use the env variable MONGO_URL. If the variable is not set the container will start a MongoDB process. Example: -e "MONGO_URL=mongodb://mongodb:27017/publisher".

For a detailed list of all environment variables see the environment variables chapter.

Backup

  1. Stop the VC Publisher container, e.g. with container name "publisher":

    docker stop publisher
  2. Backup the /vcs/database volume

  3. If you wish to have a complete backup of the VC Publisher data, it is advisable to make a security copy of both the public and private folders in the /vcs/data volume.

Uninstall

To delete an old VC Publisher container, please follow the steps below:

  1. Get a list of currently working docker containers:

    docker ps -a
  2. Note the image id and container name or id for deletion.

  3. Stop that container, e.g. for container with name "publisher":

    docker stop publisher
  4. Now that stopped container can be deleted:

    docker rm publisher
  5. Optionally you can remove the image as well, e.g. for image with id "abc123":

    docker rmi abc123

If you ran your container with mounted volumes for data persistence, the data will not be deleted by removing the container. If you want to do a clean uninstall, make sure to delete the local folders which are mounted as volumes (see step 3 of installation).