How to auto-provision device with docker compose?

How can I auto-provision my devices using docker compose? I don’t see any examples of entering the product code in the docker file? It only shows me examples of using the registration code, which would first require me to create the device in remote.it.

Here are a couple of docker-compose examples. 1 for the remoteit/remoteit-agent image and 1 for the new remoteit/docker-extension image which you can run as a regular docker container. You can also hardcode the environment variables I put in these or pass the --env-file <file> and put these environment variables in the .

version: "3.9"  # optional since v1.27.0
# This is for the remoteit/remoteit-agent docker image on dockerhub

# Set environment variables (can use .env file as well):
# CONTAINER_NAME
# R3_REGISTRATION_CODE
services:
  remoteit-agent:
    restart: unless-stopped
    image: remoteit/remoteit-agent:latest
    container_name: ${CONTAINER_NAME}
    hostname: ${CONTAINER_NAME}
    # Volumes only needed if you want to save your /etc/remoteit/* files to the local host
    volumes:
    - ./r3configs/${CONTAINER_NAME}:/etc/remoteit
    environment:
    - R3_REGISTRATION_CODE=${R3_REGISTRATION_CODE}

remoteit/docker-extension

version: "3.9"  # optional since v1.27.0
# This is for the remoteit/docker-extension docker image on dockerhub

# Set environment variables (can use .env file as well):
# CONTAINER_NAME
# R3_REGISTRATION_CODE
services:
  remoteit-agent:
    restart: unless-stopped
    image: remoteit/remoteit-agent:latest
    container_name: ${CONTAINER_NAME}
    hostname: ${CONTAINER_NAME}
    # The docker.sock volume is required so the docker-extension can read the docker container ports
    # The r3configs volume is optional and only used to save the /etc/remoteit/* config files
    volumes:
    - ./r3configs/${CONTAINER_NAME}:/etc/remoteit
    - /var/run/docker.sock:/var/run/docker.sock 
    environment:
    - R3_REGISTRATION_CODE=${R3_REGISTRATION_CODE}

Sorry, I didn’t answer your question. You should be able to put the product code into the R3_REGISTRATION_CODE environment variable. It should detect it and register it properly.