Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Doc: Document running web server from docker container (#426)

Kilian Lieret8ae83d8fc0d5
diff --git a/docs/installation/docker.md b/docs/installation/docker.md
index 725217a5..5f088c49 100644
--- a/docs/installation/docker.md
+++ b/docs/installation/docker.md
@@ -1,7 +1,10 @@
# Fallback: Usage with docker
-!!! warning "Limitations"
- The latest containerized version does not yet provide the web interface.
+!!! note "Versions"
+ The docker image gets updated with every release. This means that there is some
+ time lag between the introduction of the latest features and their availability
+ in docker.
+ We generally recommend [installing from source](source.md).
Instead of installing SWE-agent from source, you can also run the software directly using Docker.
@@ -22,7 +25,7 @@ docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock \
--config_file config/default_from_url.yaml --skip_existing=False
```
-!!! note "Windows"
+!!! tip "Windows"
If you're using docker on Windows, use `-v //var/run/docker.sock:/var/run/docker.sock`
(double slash) to escape it ([more information](https://stackoverflow.com/a/47229180/)).
@@ -36,6 +39,24 @@ docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock \
# rest of the command above
```
+!!! warning "Getting updates"
+ Even though the image `sweagent/swe-agent:latest` has the tag `latest`,
+ it is not automatically updated every time you run `docker run`. Instead,
+ you need to manually run `docker pull sweagent/swe-agent:latest` periodically.
+
+!!! tip "Retrieving generated files"
+ The optional `--rm` flag removes the docker container after the command has terminated.
+ Therefore, to retrieve files (like generated patch files) from the container, please
+ remove this flag.
+
+To run the web server, make sure to forward port 3000:
+
+```bash
+docker run -p 3000:3000 -it -v /var/run/docker.sock:/var/run/docker.sock \
+ -v $(pwd)/keys.cfg:/app/keys.cfg \
+ sweagent/swe-agent-run:latest bash start_web_ui.sh
+```
+
!!! tip "More tips"
See the [installation issues section](tips.md) for more help if you run into
trouble.
diff --git a/docs/usage/web_ui.md b/docs/usage/web_ui.md
index afd5e95e..a13b7e4d 100644
--- a/docs/usage/web_ui.md
+++ b/docs/usage/web_ui.md
@@ -17,6 +17,10 @@ from the root of the repository.
If the user interface doesn't automatically open in your browser, please open it at `http://localhost:3000`.
Running from GitHub codespaces? More tips [here](../installation/codespaces.md#running-the-web-ui).
+!!! note "Running from Docker"
+ If you run SWE-agent from the `docker-run` Docker container, please see [here](../installation/docker.md)
+ for how to start the web server.
+
## Manually starting frontend and backend
The web UI consists of a frontend written in [react][] (showing the pretty control elements) and a backend written with [flask][].