Skip to content

Commit

Permalink
Update docker-compose.
Browse files Browse the repository at this point in the history
  • Loading branch information
shajen committed Oct 27, 2023
1 parent 49e4160 commit 2cb7889
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 35 deletions.
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
TAG=latest
BROKER_TAG=latest
SDR_SCANNER_TAG=latest
MONITOR_TAG=latest
TZ=Europe/London

MQTT_HOST=sdr-broker
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
key: ${{ runner.os }}-ccache
- name: Checkout
uses: actions/checkout@v3
- name: Docker info
run: docker info
- name: Build sdr-scanner
run: |
echo "constexpr auto GIT_COMMIT = \"$(git rev-parse HEAD)\";" > sources/version.h
Expand All @@ -31,14 +29,14 @@ jobs:
- name: Test sdr-scanner
run: docker run --rm sdr-scanner-test
- name: Deploy sdr-scanner branch
if: github.ref_type == 'branch' && github.event_name != 'pull_request'
if: ${{ github.ref_type == 'branch' && github.ref_name == vars.CI_BRANCH && github.event_name != 'pull_request' }}
run: |
TAG=${GITHUB_REF_NAME}
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} docker.io
docker buildx create --use || true
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t docker.io/shajen/sdr-scanner:$TAG --push .
- name: Deploy sdr-scanner tag
if: github.ref_type == 'tag'
if: ${{ github.ref_type == 'tag' }}
run: |
TAG=${GITHUB_REF_NAME/v/}
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} docker.io
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ FROM run
COPY ./config.json /config/config.json
COPY --from=build /root/auto-sdr/build/auto_sdr /usr/bin/auto_sdr
COPY entrypoint/run.sh /entrypoint/run.sh
ENTRYPOINT ["/entrypoint/run.sh"]
CMD ["/entrypoint/run.sh"]
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ Sdr scanner use [SoapySDR](https://github.com/pothosware/SoapySDR) library to ge

## Install docker

If you do not have `docker` installed, follow the instructions available at [https://docs.docker.com/desktop/](https://docs.docker.com/desktop/) to install `docker` and `docker compose`.
If you do not have `docker` installed, follow the instructions [here](https://docs.docker.com/desktop/) to install `docker` and `docker compose`.

## Run

Download `docker-compose.yml` and run it.
```
mkdir -p ~/sdr
git clone https://github.com/shajen/rtl-sdr-scanner-cpp.git ~/sdr
cd ~/sdr
wget https://github.com/shajen/rtl-sdr-scanner-cpp/raw/master/docker-compose.yml
nano .env # customize settings if you want: timezone, admin account and other
docker compose up -d
```

Expand All @@ -59,26 +58,21 @@ cd ~/sdr
docker compose down
```

## Configuration

Open [http://localhost:8000/sdr/config/](http://localhost:8000/sdr/config/) and follow instruction [here](https://github.com/shajen/rtl-sdr-scanner-cpp/wiki/Configuration).

## Panel
## Web panel

Open [http://localhost:8000/sdr/spectrograms/](http://localhost:8000/sdr/spectrograms/) or [http://localhost:8000/sdr/transmissions/](http://localhost:8000/sdr/transmissions/) and wait for data to collect.
Web panel [here](http://localhost:8000/). Default login: `admin`, password: `password`. Configuration [here](http://localhost:8000/sdr/config/), configuration manual [here](https://github.com/shajen/rtl-sdr-scanner-cpp/wiki/Configuration), admin panel [here](http://localhost:8000/admin/).

Admin panel available at [http://localhost:8000/admin/](http://localhost:8000/admin/). Username: `admin`, password: `password`.
Open [spectrograms](http://localhost:8000/sdr/spectrograms/) or [transmissions](http://localhost:8000/sdr/transmissions/) and wait for data to collect.

Sources of panel [here](https://github.com/shajen/monitor).

## Update

To update to latest version just update `docker-compose.yml`, images and run it.
To update to latest version just update git, images and run it.
```
cd ~/sdr
docker compose down
rm docker-compose.yml
wget https://github.com/shajen/rtl-sdr-scanner-cpp/raw/master/docker-compose.yml
git pull
docker compose pull
docker compose up -d
```
Expand Down
30 changes: 15 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
services:
sdr-broker:
image: shajen/sdr-broker:${TAG:-latest}
broker:
image: shajen/broker:${BROKER_TAG:-latest}
env_file: .define.env
restart: on-failure
ports:
- ${MQTT_PORT_TCP:-1883}:${MQTT_PORT_TCP:-1883}
- ${MQTT_PORT_WS:-9001}:${MQTT_PORT_WS:-9001}
sdr-scanner:
image: shajen/sdr-scanner:${TAG:-latest}
image: shajen/sdr-scanner:${SDR_SCANNER_TAG:-latest}
env_file: .define.env
restart: on-failure
depends_on:
- sdr-broker
- broker
volumes:
- scanner_config:/config
- sdr_config:/config
devices:
- /dev/bus/usb:/dev/bus/usb
sdr-monitor-setup:
image: shajen/sdr-monitor:${TAG:-latest}
monitor-setup:
image: shajen/monitor:${MONITOR_TAG:-latest}
env_file: .define.env
restart: on-failure
depends_on:
- sdr-broker
- broker
volumes:
- monitor_db:/usr/src/sdr-panel/db
- monitor_data:/usr/src/sdr-panel/public/media
command: /entrypoint/setup.sh
sdr-monitor-server:
image: shajen/sdr-monitor:${TAG:-latest}
monitor-server:
image: shajen/monitor:${MONITOR_TAG:-latest}
env_file: .define.env
restart: on-failure
depends_on:
sdr-monitor-setup:
monitor-setup:
condition: service_completed_successfully
volumes:
- monitor_db:/usr/src/sdr-panel/db
- monitor_data:/usr/src/sdr-panel/public/media
command: /entrypoint/server.sh
ports:
- ${HTTP_PORT:-8000}:8000
sdr-monitor-worker:
image: shajen/sdr-monitor:${TAG:-latest}
monitor-worker:
image: shajen/monitor:${MONITOR_TAG:-latest}
env_file: .define.env
restart: on-failure
depends_on:
sdr-monitor-setup:
monitor-setup:
condition: service_completed_successfully
volumes:
- monitor_db:/usr/src/sdr-panel/db
- monitor_data:/usr/src/sdr-panel/public/media
command: /entrypoint/worker.sh
volumes:
scanner_config:
sdr_config:
monitor_db:
monitor_data:

0 comments on commit 2cb7889

Please sign in to comment.