diff --git a/Dockerfile b/Dockerfile index 163cfac..0cde0ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 939ee23..55ffa1b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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/ diff --git a/docker.sh b/docker.sh index 897b155..491e539 100644 --- a/docker.sh +++ b/docker.sh @@ -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 \ diff --git a/server/README.md b/server/README.md index c343322..62bc8d9 100644 --- a/server/README.md +++ b/server/README.md @@ -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 @@ -32,8 +32,7 @@ please see the [`AcceptXMR`](../library/) library instead. $ docker run -d \ --name acceptxmr \ --restart=always \ - -p :8080 \ - -p :8081 \ + --network host \ --mount type=bind,source=,target=/AcceptXMR_DB \ --mount type=bind,source=,target=/cert \ --mount type=bind,source=,target=/acceptxmr.yaml \ @@ -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: - - ":8080" - - ":8081" + network_mode: "host" volumes: - db:/AcceptXMR_DB - :/acceptxmr.yaml @@ -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 `:/ +swagger-ui/` when running `AcceptXMR-Server`. + #### Internal API The internal API serves endpoints which the end user should not have access to