Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve AcceptXMR-Server README.md #79

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM rust:1.76-slim-bookworm as build
FROM --platform=$BUILDPLATFORM rust:1.76-slim-bookworm AS build

# Create a new empty shell project.
RUN USER=root cargo new --bin acceptxmr-server
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
services:
server:
build: .
ports:
- "8080:8080"
- "8081:8081"
network_mode: "host"
volumes:
- ./AcceptXMR_DB:/AcceptXMR_DB
- ./server/tests/testdata/cert:/server/tests/testdata/cert/
Expand Down
3 changes: 1 addition & 2 deletions docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

docker run \
--name acceptxmr \
-p 8080:8080 \
-p 8081:8081 \
--network host \
--mount type=bind,source=${PWD}/AcceptXMR_DB,target=/AcceptXMR_DB \
--mount type=bind,source=${PWD}/server/tests/testdata/cert,target=/server/tests/testdata/cert \
--mount type=bind,source=${PWD}/acceptxmr.yaml,target=/acceptxmr.yaml \
Expand Down
19 changes: 9 additions & 10 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ please see the [`AcceptXMR`](../library/) library instead.
2. Clone this repository:
```bash
$ git clone https://github.com/busyboredom/acceptxmr.git
$ cd acceptxmr &&
$ cd acceptxmr
```
3. Run it:
```bash
Expand All @@ -32,8 +32,7 @@ please see the [`AcceptXMR`](../library/) library instead.
$ docker run -d \
--name acceptxmr \
--restart=always \
-p <external API port>:8080 \
-p <internal API port>:8081 \
--network host \
--mount type=bind,source=<database dir>,target=/AcceptXMR_DB \
--mount type=bind,source=<TLS cert dir>,target=/cert \
--mount type=bind,source=<config file path>,target=/acceptxmr.yaml \
Expand All @@ -43,23 +42,20 @@ please see the [`AcceptXMR`](../library/) library instead.
Note that the `acceptxmr.yaml` configuration file (described
[here](#Configuration)) applies directly to the bare `AcceptXMR-Server` service
running inside docker. The command in step (3) above will need to be adapted
appropriately if ports or paths in `acceptxmr.yaml` are changed.
appropriately if paths in `acceptxmr.yaml` are changed.

Click [here](../docker.sh) for an example command with paths and ports filled
out.
Click [here](../docker.sh) for an example command with paths filled out.

### Run with Docker Compose
1. Install Docker: https://docs.docker.com/get-docker/
2. Create a file called `docker-compose.yml` with the following contents,
setting ports and paths to whatever you desire:
setting paths to whatever you desire:
```yaml
name: acceptxmr
services:
server:
image: busyboredom/acceptxmr:latest
ports:
- "<external API port>:8080"
- "<internal API port>:8081"
network_mode: "host"
volumes:
- db:/AcceptXMR_DB
- <path to config file>:/acceptxmr.yaml
Expand Down Expand Up @@ -109,6 +105,9 @@ used server-side (i.e. not exposed to the internet). The second API is an
"external" API, which is safe to expose to the end-user (i.e. it may be exposed
to the internet).

Interactive API documentation is available for each API at `<host>:<port>/
swagger-ui/` when running `AcceptXMR-Server`.

#### Internal API

The internal API serves endpoints which the end user should not have access to
Expand Down
Loading