{"id":21178716,"url":"https://github.com/poabob/learning_locker-docker","last_synced_at":"2026-02-08T13:31:44.169Z","repository":{"id":102352450,"uuid":"452582084","full_name":"POABOB/learning_locker-docker","owner":"POABOB","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-10T14:41:09.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T11:45:15.109Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/POABOB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-27T07:27:38.000Z","updated_at":"2022-01-27T07:29:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d658678-88c3-43f2-9efd-a67f19f3260d","html_url":"https://github.com/POABOB/learning_locker-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/POABOB%2Flearning_locker-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/POABOB%2Flearning_locker-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/POABOB%2Flearning_locker-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/POABOB%2Flearning_locker-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/POABOB","download_url":"https://codeload.github.com/POABOB/learning_locker-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243629222,"owners_count":20322017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T17:23:33.504Z","updated_at":"2026-02-08T13:31:39.133Z","avatar_url":"https://github.com/POABOB.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learning Locker version 2 in Docker\n\nIt is a dockerized version of Learning Locker (LL) version 2 based on the installation guides at http://docs.learninglocker.net/guides-custom-installation/\n\n## Architecture\n\nFor LL's architecture consult http://docs.learninglocker.net/overview-architecture/\n\nThis section is about the architecture coming out of this dockerization.\n\nOfficial images of Mongo, Redis, and xAPI service are used.\nAdditionally, build creates two Docker images: nginx and app. \nLL application services are to be run on containers based on the app image. \n\nFile docker-compose.yml describes the relation between services. \nA base configuration consists of 7 containers that are run using the above-mentioned images \n(LL application containers - api, ui, and worker - are run using image app).\n\nThe only persistent locations are directories in $DATA_LOCATION (see below), \nwhich are mounted as volumes to Mongo container and app-based containers.\n\nThe origin service ui expects service api to work on localhost, \nhowever in this dockerized version the both services are run in separate containers. \nTo make connections between those services work, socat process is run within ui container to forward local tcp connections to api container.\n\n## Usage\n\nTo build the images:\n\n```\n./build-dev.sh\n```\n\nTo configure adjust settings in .env:\n\n* DOCKER_TAG - git commit (SHA-1) to be used (\"dev\" for images built by build-dev.sh)\n* DATA_LOCATION - location on Docker host where volumes are created\n* DOMAIN_NAME - domain name as the instance is to be accessed from the world\n* APP_SECRET - LL's origin setting: Unique string used for hashing, Recommended length - 256 bits\n* SMTP_* - SMTP connection settings (for TLS config, see [here](https://nodemailer.com/smtp/#tls-options))\n\nTo run the services:\n\n```\ndocker-compose up\n```\n\nOpen the site and accept non-trusted SSL/TLS certs (see below for trusted certs).\n\nTo create a new user and organisation for the site:\n\n```\ndocker-compose exec api node cli/dist/server createSiteAdmin [email] [organisation] [password]\ndocker-compose exec api node cli/dist/server createSiteAdmin tkwu@im.ncue.edu.tw NCUE_IM tkwu1234password\n```\n\n## Production usage\n\n### Deployment\n\nPreparing a remote machine for the first time, put .env file to the machine and adjust the settings as given above.\n\nTo deploy a new version (git commit) to the machine, \nset DOCKER_TAG in .env to the git commit (SHA-1),\ncopy docker-compose.yml of the git commit to the machine \n(see the SSL/TLS notice below),\nand just call the command:\n\n```\ndocker-compose up -d\n```\n\n### SSL/TLS certs\n\nMount cert files to nginx container adding a section in docker-compose.yml:\n\n```\n     volumes:\n        - \"/path-to-certs-on-docker-host/fullchain.pem:/root/ssl/fullchain.pem:ro\"\n        - \"/path-to-certs-on-docker-host/privkey.pem:/root/ssl/privkey.pem:ro\"\n```\n\n### Backups\n\nBackup $DATA_LOCATION, i.e. the Docker volumes: Mongo's data and app's storage. \n\n## Upgrading\n\nIn app/Dockerfile, git tag of LL application is declared.\nIn docker-compose.yml, image tag of xAPI service is declared.\nThe versions (tags) in use can be easily adjusted as needed.\n\nAfter upgrading these versions, you shall usually proceed as follows:\n\n```\ndocker-compose pull\ndocker-compose stop xapi worker ui api nginx\ndocker-compose run --rm api yarn migrate\ndocker-compose up\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoabob%2Flearning_locker-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoabob%2Flearning_locker-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoabob%2Flearning_locker-docker/lists"}