Docker - aaronwmorris/indi-allsky GitHub Wiki
Please ensure you have the latest docker packages installed from the Docker site. The docker build for indi-allsky requires docker compose v2.
Do NOT use the docker-compose
syntax (with the dash) which implies docker compose v1. Docker compose v2 uses docker compose
.
- x86_64
- Linux
- Windows
- Mac
- arm64
- Linux
- Mac - Apple Silicon (Mac M1+)
In most cases, INDI (core and 3rd-party) will probably have to be installed on the host running the indiserver container. The indiserver does not need to run on the host, but the host needs to create the device nodes and load the firmware so the indiserver container may connect to the devices. With privileged containers, only the devices that exist when the container is started are created within the container.
The capture container needs to be privileged
to permit access to the camera device for libcamera. A udev
related folder needs to be mapped to the container, too. These settings are available, but commented out, in the docker-compose.yaml.
Use the setup_env.sh
script to setup your .env environment file and ssl certificates
./setup_env.sh
If you have a ZWO camera, change the driver to the following
INDIALLSKY_INDI_CCD_DRIVER=indi_asi_ccd
docker compose build
If you experience dependency problems with the build, it may be necessary to manually build the base image first.
docker compose build indi.base
docker compose up
or
docker compose up --detach
Notes
- There are delays up to 120s for services to completely start
- Your camera must be plugged in prior to starting the indiserver_indi_allsky container
docker compose down
The docker compose setup sets up a single container per process.
- indiserver.indi.allsky
- privileged container
- capture.indi.allsky
- capture process
- gunicorn.indi.allsky
- python application server
- Flask database migrations managed here
- webserver.indi.allsky
- reverse proxy
- mariadb.indi.allsky
- MariaDB database
- mosquitto.indi.allsky
- Mosquitto MQTT broker
- indi.base
- intermediate image
- does not run
- indi.allsky.base
- intermediate image
- does not run
- webserver
- 8080:80
- 8443:443
- indiserver
- 17624:7624
- gunicorn
- 8000:8000 (commented out)
- mariadb
- 13306:3306 (commented out)
- mosqutto
- 18883:8883
- 18081:8081
- images_indi_allsky
- migrations_indi_allsky (flask)
- database_indi_allsky (MariaDB)
- mosquitto_indi_allsky (Mosquitto)
-
Navigate to the current git clone
cd indi-allsky
-
Pull the latest changes via git
git pull origin main
-
Rebuild containers
-
capture.indi.allsky
-
gunicorn.indi.allsky
-
webserver.indi.allsky
docker compose build capture.indi.allsky gunicorn.indi.allsky webserver.indi.allsky
-
docker compose up mariadb.indi.allsky gunicorn.indi.allsky webserver.indi.allsky
Periodically, you may want to clean up artifacts left over by the docker build process. These commands should not result in any data loss.
- Prune images
docker image prune
- Prune volumes
docker volume prune
- Prune full system
docker system prune
- WARNING: This will delete the intermediate build layers which may trigger a full rebuild if you need to update an image (for a code deploy).
You can run some of the command line scripts in the container using the following pattern. Find the capture container ID by running docker ps | grep capture.indi.allsky
docker exec -it 012345678901 /home/allsky/venv/bin/python3 /home/allsky/indi-allsky/misc/usertool.py adduser
docker exec -it 012345678901 /home/allsky/venv/bin/python3 /home/allsky/indi-allsky/misc/usertool.py setadmin
docker exec -it 012345678901 /home/allsky/venv/bin/python3 /home/allsky/indi-allsky/misc/usertool.py genapikey
docker exec -it 012345678901 /home/allsky/venv/bin/python3 /home/allsky/indi-allsky/misc/home_assistant_auto_discovery.py
# Create matching user account for allsky
sudo useradd -u 10001 -s /bin/false -M -l allsky-container
# Create dbus policy file
sudo tee /etc/dbus-1/system.d/allsky-timedate-policy.conf << 'EOF'
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="allsky-container">
<allow send_destination="org.freedesktop.timedate1"/>
<allow receive_sender="org.freedesktop.timedate1"/>
<allow send_destination="org.freedesktop.timedate1"
send_interface="org.freedesktop.DBus.Properties"/>
<allow send_destination="org.freedesktop.timedate1"
send_interface="org.freedesktop.timedate1"/>
</policy>
</busconfig>
EOF
# Reload dbus configuration
sudo systemctl reload dbus
Add to [docker-compose.yaml]
services:
gunicorn.indi.allsky:
volumes:
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:ro
Why compile INDI from source and not use the PPA?
The Ubuntu INDI PPA is a convenient place to install INDI, however, there have been many instances of package dependency errors or broken functionality. There is no way to install older packages from the PPA, therefore the only way to have enough control to ensure the system works is to compile from source.
Compiling from source also gives you the opportunity to install older versions or install from HEAD if something needs to be tested. The git tag for the source code may be changed in your .env
Why use Debian instead of Ubuntu?
This is somewhat a personal choice, but I feel Debian is a better choice for the foundation of Open Source Projects. If Debian has problems for any reason in the future, I will gladly switch to a different base image for the containers.