# Docker

We have had multiple requests for official Docker documentation and will offer it as soon as possible. No release date is currently available.

Several installers have been able to set up Docker successfully on their own, so if you have Docker experience you will likely be able to do so as well.

The [Kubernetes](/app-documentation/installation/images-and-media/kubernetes.md) documentation may be helpful to devise how to structure your deployment.

You can also connect with other installers on our #tradecraft-ops Slack channel (see [Support](/app-documentation/onboarding/support.md)).

The following is a *rough* draft of a Docker setup provided by a kind member of our community. It may not result in a working deployment.

***

Download the necessary config files from here:

{% embed url="<https://gitlab.com/obsidian.systems/tradecraft-docs>" %}

`git clone https://gitlab.com/obsidian.systems/tradecraft-docs.git`

Be sure to update the image version numbers to use the latest version listed on our [App Changelog](https://docs.tradecraft.fi/app-changelog/).

{% code title="compose.yaml" %}

```yaml
name: tradecraft

networks:
  tradecraft_net:
    name: tradecraft_net
    driver: bridge
  main_net:
    name: main_net
    external: true

services:
  tradecraft-user-daemon:
    container_name: tradecraft-user-daemon
    image: public.ecr.aws/f7x1s5j9/obsidiansystems/tradecraft:0.0.16
    command:
      - /etc/tradecraft/config.json
    env_file:
      - ./tradecraft.env
    environment:
      - OAUTH_PASSWORD=${tradecraft_OAUTH_PASSWORD}
    volumes:
      - ./tradecraft-config:/etc/tradecraft:ro
    restart: always
    networks:
      - tradecraft_net
      - main_net

  tradecraft-http-server:
    container_name: tradecraft-http-server
    image: public.ecr.aws/f7x1s5j9/obsidiansystems/tradecraft:0.0.16
    entrypoint: ["/bin/http-server"]
    command:
      - /etc/tradecraft/http-config.json
      - "47501"
    env_file:
      - ./tradecraft.env
    volumes:
      - ./tradecraft-config:/etc/tradecraft:ro
    restart: always
    networks:
      - tradecraft_net
      - main_net

  tradecraft-ui:
    container_name: tradecraft-ui
    image: public.ecr.aws/f7x1s5j9/obsidiansystems/tradecraft-ui:0.0.16
    env_file:
      - ./tradecraft.env
    volumes:
      - ./tradecraft-config/ui-backend-config.json:/config/backend/config.json:ro
      - ./tradecraft-config/oauth.json:/config/common/oauth.json:ro
      - ./tradecraft-config/route:/config/common/route:ro
    depends_on:
      - tradecraft-http-server
    restart: always
    networks:
      - tradecraft_net

  tradecraft-nginx:
    container_name: tradecraft-nginx
    image: "nginx:1.27.1"
    env_file:
      - ./tradecraft.env
    volumes:
      - ./tradecraft-nginx.conf:/etc/nginx/nginx.conf
    ports:
      - "8080:80"
    depends_on:
      - tradecraft-ui
    restart: always
    networks:
      - tradecraft_net
    healthcheck:
      test: ["CMD", "service", "nginx", "status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60se
```

{% endcode %}

{% code title="nginx" %}

```nginx
events {
    worker_connections 1024;
}

http {
  # Tradecraft UI
  server {
    listen 80;
    server_name tradecraft.cantonwallet.com;

    location / {
      proxy_pass ;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
    }
  }

  # Redirect any other domains to the Tradecraft UI
  server {
    listen 80 default_server;
    server_name _;

    location / {
      return 301 $request_uri;
    }
  }
}
```

{% endcode %}

{% code title="configs" %}

```bash
root@sendcanton02:/data/canton/mainnet# ls -lah tradecraft-config/
total 28K
drwxr-xr-x 2 root   root     4.0K Sep  8 19:11 .
drwxr-xr-x 9 byoung barg_ops 4.0K Sep 24 13:29 ..
-rw-r--r-- 1 root   root      670 Sep  8 18:07 config.json
-rw-r--r-- 1 root   root      380 Sep  8 19:00 http-config.json
-rw-r--r-- 1 root   root      134 Sep  8 16:51 oauth.json
-rw-r--r-- 1 root   root       35 Sep  8 16:52 route
-rw-r--r-- 1 root   root      166 Sep  8 19:11 ui-backend-config.json
```

{% endcode %}

The key is overriding the entry point on the container since the default image tries to launch right into the user daemon for the http server.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tradecraft.fi/app-documentation/installation/images-and-media/docker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
