CodeWithMe Help

Docker-compose setup

Before you start

Before setting up the docker-compose, make sure you have the following:

  • Decide whether or not you want to test the setup with real subdomains or dummy ones provided in the setup as examples (lobby.cwm.internal, relay.cwm.internal)

  • Ensure you have certificates for these subdomains (self-signed or purchased) or generate them

  • Ensure you have network access to DockerHub from the machine you use for the setup

  • Ensure the docker-compose version is 1.27 or higher. You may need to install a fresh version manually.

  • The README.md file of the provided archive contains short installation reminders.

Set up docker-compose

  1. Download the docker-compose setup archive from JetBrains web site

  2. Unpack the archive.

  3. Put or copy the license.key obtained from JetBrains (trial or purchased) to the ./lobby/license.key file.

    By default, the file is empty and goes as an example.

  4. Put certificates for lobby and relay subdomains to ./nginx/ssl/.

  5. Generate certificates for lobby and relay components:

    openssl ecparam -name secp384r1 -genkey -noout -out lobby/lobby_private.pemopenssl ec -in lobby/lobby_private.pem -pubout -out relay/lobby_public.pem

  6. If you use the setup with our dummy subdomains, add them to the local hosts file.

  7. If you use your subdomains, edit the following files:

    • ./nginx/nginx.conf (server_name)

    • docker-compose.yaml (BASE_URL)

    • ./lobby/config.json (wss:/relay)

Run docker-compose up to start containers.

Example

Check the following code example on how to set up a docker-compose:

ubuntu@aws:~$ cat docker-compose.yaml # Based on https://www.jetbrains.com.cn/en-us/help/cwm/code-with-me-administration-guide.html version: "3.8" services: nginx: image: nginx:1.19.8 volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/ssl:/etc/ssl/nginx:ro ports: - 443:443 relay: image: jetbrains/code-with-me-relay:1203 command: # - -allow-server-without-authentication - -addr - 0.0.0.0:3274 - -jwt-key-file - /ws-relayd/lobby_public.pem - -jwt-key-type # can be (hmac, rsa, ecdsa) - ecdsa # - -prometheus-addr # - 127.0.0.1:4422 volumes: - ./relay/lobby_public.pem:/ws-relayd/lobby_public.pem:ro lobby: image: jetbrains/code-with-me-lobby:2013 environment: BASE_URL: https://lobby.cwm.internal LICENSE_BUNDLES: /home/lobby-server/config/license.key JSON_CONSOLE_LOGGING: "false" SERVER_PORT: "2093" # SERVER_LISTEN_ON: "0.0.0.0" ROOT_PREFIX: "/" DIAGNOSTICS_PORT: CONFIG_JSON: /home/lobby-server/config/config.json RELAYS_ECDSA_JWT_KEY_FILE: /home/lobby-server/config/lobby_private.pem ## JITSI_URL: https://meet.jit.si # JITSI_RSA_JWT_KEY_FILE: /home/lobby-server/config/jitsi_jwt.key REDIS_HOST: redis REDIS_PORT: 6379 ENABLED_FEATURES: ws_relay,p2p_quic,direct_tcp,jitsi_telephony,project_names,user_names volumes: - ./lobby/:/home/lobby-server/config/:ro redis: image: redis:latest command: ["redis-server", "--appendonly", "yes"] volumes: - ./redis/data:/data
Last modified: 23 February 2024