set_image localhost/{{PROJECT}}:latest

# add_devices /dev/ttymxc0
add_devices /dev/ttymxc1

# for read window.xml
add_volumes /var/app/volumes/usb:/root/usb
add_args --cap-add=SYS_ADMIN
# add_devices /dev/sda1

# for VPU and NPU
add_volumes /opt/firmware:/opt/firmware:ro
add_devices /dev/dri /dev/galcore

# for video decoding
add_devices /dev/mxc_hantro /dev/mxc_hantro_vc8000e /dev/ion

# for video
add_hotplugs video4linux

# for audio
add_devices /dev/snd

# for weston
add_volumes /run/udev:/run/udev:ro
add_hotplugs input
add_devices /dev/tty7
add_args --cap-add=SYS_TTY_CONFIG

# for flutter debugging
# add_ports 41077:41077
# add_args --env FLUTTER_ENGINE_SWITCHES=2
# add_args --env FLUTTER_ENGINE_SWITCH_1=observatory-port=41077
# add_args --env FLUTTER_ENGINE_SWITCH_2=observatory-host=0.0.0.0

# set timezone
add_args -e TZ=Asia/Tokyo

# mount app sources and data:
# - /var/app/rollback/volumes can be rolled back on failed
# upgrades, suitable for application sources and assets.
# - /var/app/volumes is not copied on updates and more suitable
# for volatile data such as logs and databases.
add_volumes /var/app/rollback/volumes/{{PROJECT}}:/vol_app
add_volumes /var/app/volumes/{{PROJECT}}:/vol_data

# Add environment variables set by Atmark Techno.
add_armadillo_env

# flutter can fail with success exit code
set_restart always

# for Bluetooth
#bluetooth set_network host
#bluetooth add_args --cap-add=NET_ADMIN
#bluetooth add_args --tmpfs /run/dbus

# set network
set_network host

# launch flutter app and weston at container startup
# set_command flutter_launch
set_command sh -c 'flutter_launch > /dev/ttymxc1'
