{"id":20156126,"url":"https://github.com/openfun/openedx-docker","last_synced_at":"2025-04-04T08:05:23.190Z","repository":{"id":29291742,"uuid":"120597874","full_name":"openfun/openedx-docker","owner":"openfun","description":":whale: A best practice Docker image of Open edX","archived":false,"fork":false,"pushed_at":"2025-01-14T10:55:19.000Z","size":1833,"stargazers_count":130,"open_issues_count":21,"forks_count":77,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-28T07:07:15.298Z","etag":null,"topics":["django","docker","docker-image","edx","edx-platform","lms","openeducation","openedx"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/fundocker/edxapp","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-02-07T10:07:28.000Z","updated_at":"2025-03-19T00:26:37.000Z","dependencies_parsed_at":"2023-10-10T23:04:20.611Z","dependency_job_id":"876641ba-0892-471e-bb35-c0d183f4cbc1","html_url":"https://github.com/openfun/openedx-docker","commit_stats":null,"previous_names":[],"tags_count":203,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfun%2Fopenedx-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfun%2Fopenedx-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfun%2Fopenedx-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfun%2Fopenedx-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfun","download_url":"https://codeload.github.com/openfun/openedx-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247142062,"owners_count":20890652,"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":["django","docker","docker-image","edx","edx-platform","lms","openeducation","openedx"],"created_at":"2024-11-13T23:37:40.878Z","updated_at":"2025-04-04T08:05:23.169Z","avatar_url":"https://github.com/openfun.png","language":"Python","readme":"# Open edX Docker\n\nFrance Université Numérique introduces an alternative `Docker` approach to\ninstall a complete and customized version of [Open edX](https://open.edx.org).\n\nThe idea is to handcraft a `Dockerfile`, in order to make the project simpler,\nmore flexible and fully operable by developers.\n\n## Quick preview\n\nIf you're looking for a quick preview of OpenEdX Docker, you can take a look\nat our dedicated [demo site](https://demo.richie.education).\n\nIt is connected back-to-back with a demo of Richie,\n[a CMS for Open Education](https://richie.education) based on Django.\n\nTwo users are available for testing:\n\n- admin: `admin@example.com`/`admin`\n- student: `edx@example.com`/`edx`\n\nRichie's admin is available at https://demo.richie.education/admin/ and can be\naccessed via the following user account: `admin`/`admin`.\n\nThe demonstration databases are regularly flushed.\n\n## Approach\n\nThis project builds a docker image that is ready for production.\n\nAt France Université Numérique, we are deploying Open edX Docker to OpenShift,\nfor many customers and in multiple environments using\n[Arnold](https://github.com/openfun/arnold):\n\n- The Open edX settings were polished to unlock powerful configuration\n  management features: sensible defaults, flexible overrides using YAML files\n  and/or environment variables, secure credentials using Ansible Vault and PGP\n  keys,\n- We focused on a best practice installation of `edxapp`, the core Open edX\n  application. You can build you own image by adding specific Xblocks or Django\n  apps in a `Dockerfile` inheriting from this one (see\n  https://github.com/openfun/fonzie for an example).\n\nDocker compose is only used for development purposes so that we can code locally\nand see our changes immediately:\n\n- sources and configuration files are mounted from the host,\n- the Docker CMD launches Django's development server instead of `gunicorn`,\n- ports are opened on the application containers to allow bypassing `nginx`.\n\nDocker compose also allows us to run a complete project in development,\nincluding database services which in production are not run on Docker. See the\n[docker-compose file](./docker-compose.yml) for details on each service:\n\n- **mysql:** the SQL database used to structure and persist the application\n  data,\n- **mongodb:** the no-SQL database used to store course content,\n- **memcached:** the cache engine,\n- **lms:** the Django web application used by learners,\n- **cms:** the Django web application used by teachers,\n- **nginx:** the front end web server configured to serve static/media files and\n  proxy other requests to Django.\n- **mailcatcher** the email backend\n\nConcerning Redis, it is possible to run a single redis instance (the default choice)\nor to run redis with sentinel to simulate a HA instance.\nTo use Redis sentinel you have to set the `REDIS_SERVICE` environment variable\nto `redis-sentinel`:\n\n```bash\n$ export REDIS_SERVICE=redis-sentinel\n```\n\nTo switch back to the single redis instance, unset this environment variable:\n\n```bash\n$ unset REDIS_SERVICE\n```\n\n## Prerequisite\n\nMake sure you have a recent version of [Docker](https://docs.docker.com/install)\nand [Docker Compose](https://docs.docker.com/compose/install) installed on your\nlaptop:\n\n```bash\n$ docker -v\n  Docker version 26.0.0, build 2ae903e\n\n$ docker compose version\n  docker compose version v2.24.5\n```\n\n## Getting started\n\nFirst, you need to choose a release/flavor of OpenEdx versions we support. You\ncan list them and get instructions about how to select/activate a target release\nusing the `bin/activate` script. An example output follows:\n\n```bash\n$ bin/activate\nSelect an available release to activate:\n[1] master/0/bare (default)\n[2] hawthorn/1/bare\n[3] hawthorn/1/oee\nYour choice: 3\n\n# Copy/paste hawthorn/1/oee environment:\nexport EDX_RELEASE=\"hawthorn.1\"\nexport FLAVOR=\"oee\"\nexport EDX_RELEASE_REF=\"open-release/hawthorn.1\"\nexport EDX_DEMO_RELEASE_REF=\"open-release/hawthorn.1\"\n\n# Or run the following command:\n. ${HOME}/Work/openedx-docker/releases/hawthorn/1/oee/activate\n\n# Check your environment with:\nmake info\n```\n\nOnce your environment is set, start the full project by running:\n\n```bash\n$ make bootstrap\n```\n\nYou should now be able to view the web applications:\n\n- LMS served by `nginx` at: [http://localhost:8073](http://localhost:8073)\n- CMS served by `nginx` at: [http://localhost:8083](http://localhost:8083)\n\nSee other available commands by running:\n\n```bash\n$ make --help\n```\n\n## Developer guide\n\nIf you intend to work on edx-platform or its configuration, you'll need to\ncompile static files in local directories that are mounted as docker volumes in\nthe target container:\n\n```bash\n$ make dev-assets\n```\n\nNow you can start services development server _via_:\n\n```bash\n$ make dev\n```\n\nYou should be able to view the web applications:\n\n- LMS served by Django's development server at:\n  [http://localhost:8072](http://localhost:8072)\n- CMS served by Django's development server at:\n  [http://localhost:8082](http://localhost:8082)\n\n### Hacking with themes\n\nTo work on a particular theme, we invite you to use the `paver watch_assets`\ncommand; _e.g._:\n\n```bash\n$ make dev-watch\n```\n\n**Troubleshooting**: if the command above raises the following error:\n\n```\nOSError: inotify watch limit reached\n```\n\nThen you will need to increase the **host**'s `fs.inotify.max_user_watches`\nkernel setting (for reference, see https://unix.stackexchange.com/a/13757):\n\n```ini\n# /etc/sysctl.conf (debian based)\nfs.inotify.max_user_watches=524288\n```\n\n## Available Docker images\n\nThe aim of this project is to prepare several flavors of images, the docker\nfiles and settings of which are living in their own directory (see\n[`releases/`](./releases/))\n\nRelease paths on the current repository are of the form:\n\n```\n{release name}/{release number}/{flavor}\n```\n\nWith:\n\n- **release name**: OpenEdx release name (_e.g._ `hawthorn`)\n- **release number**: OpenEdx release number (_e.g._ `1`)\n- **flavor**: the release flavor (_e.g._ `bare` for standard OpenEdx release and\n  `oee` for OpenEdx Extended release).\n\nWe are pushing to `DockerHub` only images that are the result of a tag\nrespecting the following pattern:\n\n```\n{release}(-{flavor})-x.y.z\n```\n\nThe `release` (_e.g._ `hawthorn.1`) typically includes the `release name`\n(_e.g._ `hawthorn`) and the `release number` (_e.g._ `1`). The flavor is\noptional.\n\nHere are some valid examples:\n\n- `dogwood.3-1.0.3`\n- `hawthorn.1-oee-2.0.1`\n\n## Nginx\n\nThis project also provides an nginx companion image that can be used\nalongside the `edxapp` image for faster deployments and better performance.\n\nThe classical way to handle and serve static files in a Django application is\nto collect them (using the `collectstatic` management command) and post-process\nthem using an appropriate storage back-end that uses cache-busting techniques\nto avoid old _versus_ new static files collisions (_e.g._\n`ManifestStaticFilesStorage`).\n\nDepending on the `edx-platform` release, some files may not benefit from a\ncache busting md5 hash, leading to unexpected side effects during deployment.\n\nTo prevent such behavior, for each new `openedx-docker` release, we will also\nrelease an\n[`edxapp-nginx`](https://hub.docker.com/repository/docker/fundocker/edxapp-nginx/)\nimage with the same Docker tag. This image is an [OpenShift-ready `nginx`\nimage](https://github.com/openfun/openshift-docker#nginx) with embedded\n`edxapp`'s static files. You are supposed to use this image to serve your\nstatic files, media and reverse proxy to the version-matching `edxapp` instance.\n\n## Alternative projects\n\nIf what you're looking for is a quick 1-click installation of the complete Open\nedX stack, you may take a look at [Tutor](https://github.com/overhangio/tutor).\n\n## License\n\nThe code in this repository is licensed under the GNU AGPL-3.0 terms unless\notherwise noted.\n\nPlease see [`LICENSE`](./LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfun%2Fopenedx-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfun%2Fopenedx-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfun%2Fopenedx-docker/lists"}