Changes

From Amahi Wiki
Jump to: navigation, search
30 bytes added ,  00:16, 7 September 2017
Lets assume we are trying to run multiple container apps. Let them be App1, App2, App3 and App4.
'''NOTE: ''' Each app will have its own networking stack and hence can run a service on any port that they want.
App1 - 9000, 80
EOF
docker-compose up -d
 
This script creates a docker-compose.yml file and then runs `docker-compose up -d` command which essentially creates and runs the container.
install_script = install_script.gsub(/APP_IDENTIFIER/, identifier)
install_script = install_script.gsub(/APP_HOSTNAME/, app_host)
 
Sample uninstall script
# Not removing the image. Just stopping the container.
For most containers the above uninstallation script will work fine. This stops the running container and removes it. Please note that this doesn't delete any of the volumes attached (persistent storage. Please refer to docker documentatio documentation for more details regarding volumes) with the container so if you add a volume during installation (as we have done in the gitlab example above) then we have to remove them here during uninstallation. For example if we were to remove gitlab completely along with all files that were added by gitlab container then the uninstall script would look something like this:
docker-compose stop
rm -rf srv # Removing the srv folder which holds the persistent files for gitlab container
 This behaviour behavior might not be intended for all applications. Right now I haven't removed static files for any apps that I have added.
===Reverse Proxy===
CustomLog APP_ROOT_DIR/logs/access_log combined env=!dontlog
</VirtualHost>
 
APP_PORT part is derived from the app id. After installation the app will have some id in the database base. The APP_PORT will be 35000+app_id
-e TZ=<timezone> \
-p 5075:5075 linuxserver/hydra
 
Convert the above to a docker-compose file. Ignore the `-e PGID=<gid> -e PUID=<uid>`, even though it's relevant, it is out of the scope of this discussion.
- './downloads:/downloads'
- '/etc/localtime:/etc/localtime:ro'
# Understanding the volume mounts:
# ./config:/config -> As seen in the docker create commnad the -v command mentions the volumes.
# - TZ=<timezone>
# in the docker compose file
 
'''NOTE:''' Please note that adding apps might require knowledge about docker and docker-compose and discussing those is out of the scope of this documentation though the links mentioned below might be useful.
EOF
docker-compose up -d
 
Uninstall Script
rm -rf config # Use this if you want all files to be removed after uninstall
rm -rf downloads # Use this if you want all files to be removed after uninstall
 
For more examples of install scripts and docker-compose files of different apps please refer to [https://github.com/vik-y/amahi_images amahi_images repo.] or the table given below.
 {|class="wikitable"|+ <big>'''App examples'''</big>
! Example app
! install-script
12,424

edits