Skip to content

Commit

Permalink
fix: local docker container can now build when project is opened in R…
Browse files Browse the repository at this point in the history
…studio
  • Loading branch information
joelbeckmann committed May 2, 2024
1 parent 5c38b75 commit 32fafe6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.git
.gitignore
.github
.Rproj.user
.Rhistory
README.md
dev_local
39 changes: 34 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,38 @@

# Development

## Start a local opencpu server
## Testing with a local OpenCPU server

* run `docker-compose up -d` in the `dev_local` directory of this repository
* run `docker-compose down` to stop the server
* open `http://localhost:80/ocpu/` in your browser to see the opencpu server
* test fearbase package by posting requests in `../library/fearbase/`
You can test how any changes you make to the fearbase R package affect the deployment of the OpenCPU server by running an
OpenCPU server locally.


### Start the OpenCPU server:

In the `dev_local` directory of this repository run:

```bash
docker compose up -d --build
```

### Stop the OpenCPU server

```php
docker compose down
```

### Update the OpenCPU server
After making changes to the fearbase package. Simply run
```php
docker compose up -d --build
```
again.
If you **don't see any changes** it might be the browser caching an old state of the Docker container.
In that case either delete your browser cache or open the OpenCPU API Explorer in a new **private/icognito session**.

### Testing on the OpenCPU server

Open [http://localhost/ocpu/](http://localhost:80/ocpu/) in your browser to access the OpenCPU API Explorer interface.

In the interface you can run any functions and access included data of the fearbase package by making requests in `../library/fearbase/`.
Check the [OpenCPU API docs](https://www.opencpu.org/api.html#api-methods) for information on how to use the OpenCPU API Explorer

0 comments on commit 32fafe6

Please sign in to comment.