Web application deployment

The following sections will configure the web application using the docker compose configuration detailed in Container-Based deployment. The steps can easily be adapted or ignored if you used the direct install method.

Obtaining the web application

For a given release, you can obtain the corresponding web application by looking for the asset named parsec-web-{version}.zip in the release’s asset files.

  1. For the current release, you can download the webapp by using this link: webapp:

    curl --fail -L -o parsec-web.zip \
      https://github.com/Scille/parsec-cloud/releases/download/v3.9.1-a.0+dev/parsec-web-3.9.1-a.0+dev.zip
    
  2. Once the archive downloaded, extract it under parsec-web:

    unzip -d parsec-web parsec-web.zip
    

Minimal configuration

This section describes the minimal configuration needed for the webapp.

With the webapp files downloaded, we need to update the server configuration to make it serve the webapp as such:

  • Mount the webapp assets directory in the server container

    Note

    Ignore this step if you’re using the direct install approach.

  • Configure the server to inform where the webapp files are located

This can be summarized into the following patch that can be applied with:

patch -t -i webapp-compose-server.patch
webapp-compose-server.patch
diff --git a/docs/hosting/deployment/parsec-server.docker.yaml b/docs/hosting/deployment/parsec-server.docker.yaml
index 2623f44d3d..81def1cc39 100644
--- a/docs/hosting/deployment/parsec-server.docker.yaml
+++ b/docs/hosting/deployment/parsec-server.docker.yaml
@@ -58,6 +58,7 @@ services:
       - parsec-postgres
     image: ghcr.io/scille/parsec-cloud/parsec-server:3.9.1-a.0+dev
     restart: on-failure
+    command: run --with-client-web-app=/web
     container_name: parsec-server
     env_file:
       - parsec.env
@@ -67,6 +68,8 @@ services:
       - parsec-admin-token.env
     environment:
       AWS_CA_BUNDLE: /run/secrets/mini-ca-crt
+    volumes:
+      - ./parsec-web:/web:ro
     secrets:
       - mini-ca-crt
       - parsec-pem-crt

With a reverse proxy

This section describes how to configure the reverse proxy configuration to serve the webapp files instead of having the server do it.

Note

You still need to do the minimal configuration

  1. Mount the webapp asset’s directory into the reverse proxy container (nginx here):

    Note

    Ignore this step if you’re using the direct install approach.

    webapp-compose-nginx.patch
    diff --git a/docs/hosting/deployment/parsec-server.docker.yaml b/docs/hosting/deployment/parsec-server.docker.yaml
    index 81def1cc39..1b06dc46fb 100644
    --- a/docs/hosting/deployment/parsec-server.docker.yaml
    +++ b/docs/hosting/deployment/parsec-server.docker.yaml
    @@ -11,6 +11,7 @@ services:
           - ./parsec-nginx.conf:/etc/nginx/nginx.conf:ro
           - ./parsec-proxy.crt:/certs/proxy.crt:ro
           - ./parsec-proxy.key:/certs/proxy.key:ro
    +      - ./parsec-web:/var/www/parsec-web:ro
     
       parsec-postgres:
         image: postgres:16.10-alpine
    

    This patch can be applied with:

    patch -t -i webapp-compose-nginx.patch
    
  2. Update the reverse proxy configuration to server the files:

    parsec-nginx.conf.patch
    diff --git a/docs/hosting/deployment/parsec-nginx.conf b/docs/hosting/deployment/parsec-nginx.conf
    index 10fe651e02..bf2080be9c 100644
    --- a/docs/hosting/deployment/parsec-nginx.conf
    +++ b/docs/hosting/deployment/parsec-nginx.conf
    @@ -17,6 +17,13 @@ http {
             ssl_certificate     /certs/proxy.crt;
             ssl_certificate_key /certs/proxy.key;
     
    +        include /etc/nginx/mime.types;
    +
    +        location /client/.* {
    +            alias /var/www/parsec-web/;
    +            try_files $uri /client/index.html;
    +        }
    +
             location ~ ^/authenticated/.*/events$ {
                 proxy_pass https://parsec-server:6777;
     
    

    This patch can be applied with:

    patch -t -i parsec-nginx.conf.patch