├── .dockerignore ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── assets ├── cache_store.yml ├── database.yml ├── dbinit.sh ├── development-local.rb ├── outgoing_mail.yml ├── pg_hba.conf ├── redis.yml ├── start.sh └── supervisord.conf └── buildspec.yml /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | .idea 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | 25 | # PyInstaller 26 | # Usually these files are written by a python script from a template 27 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 28 | *.manifest 29 | *.spec 30 | 31 | # Installer logs 32 | pip-log.txt 33 | pip-delete-this-directory.txt 34 | 35 | # Unit test / coverage reports 36 | htmlcov/ 37 | .tox/ 38 | .coverage 39 | .cache 40 | nosetests.xml 41 | coverage.xml 42 | 43 | # Translations 44 | *.mo 45 | *.pot 46 | 47 | # Django stuff: 48 | *.log 49 | 50 | # Sphinx documentation 51 | docs/_build/ 52 | 53 | # PyBuilder 54 | target/ 55 | 56 | # PyCharm 57 | .idea/ 58 | 59 | # fig config 60 | fig.yml 61 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | MAINTAINER Jay Luker 4 | 5 | ARG REVISION=master 6 | ENV RAILS_ENV development 7 | ENV GEM_HOME /opt/canvas/.gems 8 | ENV YARN_VERSION 0.27.5-1 9 | 10 | # add nodejs and recommended ruby repos 11 | RUN apt-get update \ 12 | && apt-get -y install curl software-properties-common \ 13 | && add-apt-repository -y ppa:brightbox/ruby-ng \ 14 | && apt-get update \ 15 | && apt-get install -y ruby2.4 ruby2.4-dev supervisor redis-server \ 16 | zlib1g-dev libxml2-dev libxslt1-dev libsqlite3-dev postgresql \ 17 | postgresql-contrib libpq-dev libxmlsec1-dev curl make g++ git \ 18 | unzip fontforge libicu-dev 19 | 20 | RUN curl -sL https://deb.nodesource.com/setup_6.x | bash \ 21 | && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ 22 | && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ 23 | && apt-get update \ 24 | && apt-get install -y --no-install-recommends \ 25 | nodejs \ 26 | yarn="$YARN_VERSION" \ 27 | unzip \ 28 | fontforge 29 | 30 | RUN apt-get clean && rm -Rf /var/cache/apt 31 | 32 | # Set the locale to avoid active_model_serializers bundler install failure 33 | RUN locale-gen en_US.UTF-8 34 | ENV LANG en_US.UTF-8 35 | ENV LANGUAGE en_US:en 36 | ENV LC_ALL en_US.UTF-8 37 | 38 | RUN groupadd -r canvasuser -g 433 && \ 39 | adduser --uid 431 --system --gid 433 --home /opt/canvas canvasuser && \ 40 | adduser canvasuser sudo && \ 41 | echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 42 | 43 | RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="-i /var/lib/gems/$RUBY_MAJOR.0"; fi \ 44 | && gem uninstall --all --ignore-dependencies --force $BUNDLER_INSTALL bundler \ 45 | && gem install bundler --no-document -v 1.15.2 \ 46 | && chown -R canvasuser: $GEM_HOME 47 | 48 | #RUN gem install bundler --version 1.14.6 49 | 50 | COPY assets/dbinit.sh /opt/canvas/dbinit.sh 51 | COPY assets/start.sh /opt/canvas/start.sh 52 | RUN chmod 755 /opt/canvas/*.sh 53 | 54 | COPY assets/supervisord.conf /etc/supervisor/supervisord.conf 55 | COPY assets/pg_hba.conf /etc/postgresql/9.3/main/pg_hba.conf 56 | RUN sed -i "/^#listen_addresses/i listen_addresses='*'" /etc/postgresql/9.3/main/postgresql.conf 57 | 58 | RUN cd /opt/canvas \ 59 | && git clone https://github.com/instructure/canvas-lms.git \ 60 | && cd canvas-lms \ 61 | && git checkout $REVISION 62 | 63 | WORKDIR /opt/canvas/canvas-lms 64 | 65 | COPY assets/database.yml config/database.yml 66 | COPY assets/redis.yml config/redis.yml 67 | COPY assets/cache_store.yml config/cache_store.yml 68 | COPY assets/development-local.rb config/environments/development-local.rb 69 | COPY assets/outgoing_mail.yml config/outgoing_mail.yml 70 | 71 | RUN for config in amazon_s3 delayed_jobs domain file_store security external_migration \ 72 | ; do cp config/$config.yml.example config/$config.yml \ 73 | ; done 74 | 75 | RUN $GEM_HOME/bin/bundle install --jobs 8 --without="mysql" 76 | RUN yarn install --pure-lockfile 77 | RUN COMPILE_ASSETS_NPM_INSTALL=0 $GEM_HOME/bin/bundle exec rake canvas:compile_assets_dev 78 | 79 | RUN mkdir -p log tmp/pids public/assets public/stylesheets/compiled \ 80 | && touch Gemmfile.lock 81 | 82 | RUN service postgresql start && /opt/canvas/dbinit.sh 83 | 84 | RUN chown -R canvasuser: /opt/canvas 85 | RUN chown -R canvasuser: /tmp/attachment_fu/ 86 | 87 | # postgres 88 | EXPOSE 5432 89 | # redis 90 | EXPOSE 6379 91 | # canvas 92 | EXPOSE 3000 93 | 94 | CMD ["/opt/canvas/start.sh"] 95 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2016 President and Fellows of Harvard College 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![](https://images.microbadger.com/badges/image/lbjay/canvas-docker.svg)](http://microbadger.com/images/lbjay/canvas-docker "Get your own image badge on microbadger.com") 2 | [![](https://images.microbadger.com/badges/version/lbjay/canvas-docker.svg)](http://microbadger.com/images/lbjay/canvas-docker "Get your own version badge on microbadger.com") 3 | 4 | # canvas-docker 5 | 6 | ## Overview 7 | 8 | **docker-canvas** aims to provide a simple, disposable, containerized Canvas instance for fast(ish) integration testing of LTI applications. 9 | 10 | ## Prerequisites 11 | 12 | * [docker](https://www.docker.com/) (developed & tested w/ v1.12.1) 13 | 14 | ## Running 15 | 16 | `docker run --name canvas-docker -p 3000:3000 -d lbjay/canvas-docker` 17 | 18 | This repo is [registered](https://registry.hub.docker.com/u/lbjay/canvas-docker/) at Docker Hub as an automated build. So you should also be able to `docker pull lbjay/canvas-docker` to get the pre-built image. 19 | 20 | ## Building 21 | 22 | 1. Clone this repo somewhere. 23 | 2. Build the image: `docker build -t canvas-docker .` 24 | 3. Start the container: `docker run -t -i -p 3000:3000 --name canvas-docker canvas-docker` 25 | 4. Point your browser to [http://localhost:3000](http://localhost:3000). The admin user/pass login is `canvas@example.edu` / `canvas-docker`. 26 | 27 | ## The "fat" container 28 | 29 | The `Dockerfile` and associated build scripts create a resulting docker image where all necessary services of the Canvas instance are run within a single container. This approach is sometimes called a "fat" container. This admittedly goes against the "Docker Philosophy" of *one concern per container*, but for the intended purposes of the image it offers a couple of advantages, chief among them, faster spin-up times. The functionality focus is on creating a tool for integration testing of external (LTI) apps, not general canvas development, scalability, or, god forbid, actual deployment. 30 | 31 | ## Default developer_key & API access token 32 | 33 | The image build includes the injection of default `developer_key` and `access_token` entries into the database. 34 | 35 | * **developer key**: test_developer_key 36 | * **access token**: canvas-docker 37 | 38 | API requests should be possible, e.g., 39 | 40 | `curl -H "Authorization: Bearer canvas-docker" http://localhost:3000/api/v1/courses` 41 | 42 | The developer key is for use with Canvas's [OAuth2 Token Request Flow](https://canvas.instructure.com/doc/api/file.oauth.html). 43 | For example, if you're making use of [harvard-dce/django-canvas-api-token](https://github.com/harvard-dce/django-canvas-api-token). 44 | 45 | ## Outgoing Email 46 | 47 | By default the instance's outgoing email `delivery_method` will be set to "test", meaning outgoing emails, such as user registration messages, will be 48 | sent to the container's stdout. 49 | 50 | To configure 'smtp' delivery set the following $ENV values at runtime: 51 | 52 | * **EMAIL_DELIVERY_METHOD** (set this to "smtp") 53 | * **SMTP_ADDRESS** 54 | * **SMTP_PORT** 55 | * **SMTP_USER** 56 | * **SMTP_PASS** 57 | 58 | Example using [Mandrill](https://mandrillapp.com/): 59 | 60 | ``` 61 | docker run -d --name=canvas -p 3000:3000 -e EMAIL_DELIVERY_METHOD=smtp -e SMTP_ADDRESS=smtp.mandrillapp.com -e SMTP_PORT=587 -e SMTP_USER= -e SMTP_PASS= lbjay/canvas-docker 62 | ``` 63 | 64 | ## Details 65 | 66 | * The resulting canvas image is built and run using `RAILS_ENV=development`. At some point I might try creating a separate "production" flavor, but, because docker doesn't allow the setting of build-time variables except in the `Dockerfile`, it would require a separate `Dockerfile`. Also, when I did try building with `RAILS_ENV=production`, the resulting instance had issues with routing errors to the compiled assets, and the `db:initial_setup` rake task threw lots of warnings about missing triggers (?). So that. 67 | * Everything is currently somewhat "opinionated" in that things that would be nice to have configurable are hard-coded, e.g., postgres and canvas usernames, postgres network settings, path to the postgres data, etc. 68 | * The `Dockerfile` build process mostly follows Canvas's [Quick Start](https://github.com/instructure/canvas-lms/wiki/Quick-Start) guidelines with a few exeptions: 69 | * as mentioned above, `RAILS_ENV=development` 70 | * redis is installed, configured and used 71 | * the `delated_job` background task is executed 72 | * postgres is configured to not require a password for local connections, or for connections originating within a network defined by Docker's default network bridge setup: 172.17.0.0/16. 73 | 74 | ## Contributors 75 | 76 | * Jay Luker - [lbjay](https://github.com/lbjay) 77 | 78 | ## License 79 | 80 | Apache 2.0 81 | 82 | ## Copyright 83 | 84 | 2016 President and Fellows of Harvard College 85 | -------------------------------------------------------------------------------- /assets/cache_store.yml: -------------------------------------------------------------------------------- 1 | test: 2 | cache_store: redis_store 3 | 4 | development: 5 | cache_store: redis_store 6 | 7 | production: 8 | cache_store: redis_store 9 | -------------------------------------------------------------------------------- /assets/database.yml: -------------------------------------------------------------------------------- 1 | test: 2 | adapter: postgresql 3 | encoding: utf8 4 | database: canvas_test 5 | host: localhost 6 | username: postgres 7 | timeout: 5000 8 | 9 | login: &login 10 | adapter: postgresql 11 | encoding: utf8 12 | timeout: 5000 13 | username: "canvas" 14 | 15 | development: 16 | <<: *login 17 | database: canvas_development 18 | queue: 19 | <<: *login 20 | database: canvas_queue_development 21 | 22 | production: 23 | <<: *login 24 | database: canvas_production 25 | queue: 26 | <<: *login 27 | database: canvas_queue_production 28 | -------------------------------------------------------------------------------- /assets/dbinit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | export POSTGRES_BIN=/usr/lib/postgresql/9.3/bin 5 | 6 | sudo -u postgres $POSTGRES_BIN/createuser --superuser canvas 7 | sudo -u postgres $POSTGRES_BIN/createdb -E UTF-8 -T template0 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8 --owner canvas canvas_$RAILS_ENV 8 | sudo -u postgres $POSTGRES_BIN/createdb -E UTF-8 -T template0 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8 --owner canvas canvas_queue_$RAILS_ENV 9 | 10 | export CANVAS_LMS_ADMIN_EMAIL="canvas@example.edu" 11 | export CANVAS_LMS_ADMIN_PASSWORD="canvas-docker" 12 | export CANVAS_LMS_ACCOUNT_NAME="Canvas Docker" 13 | export CANVAS_LMS_STATS_COLLECTION="opt_out" 14 | 15 | cd /opt/canvas/canvas-lms \ 16 | && $GEM_HOME/bin/bundle exec rake db:initial_setup 17 | 18 | psql -U canvas -d canvas_development -c "INSERT INTO developer_keys (api_key, email, name, redirect_uri) VALUES ('test_developer_key', 'canvas@example.edu', 'Canvas Docker', 'http://localhost:8000');" 19 | 20 | # 'crypted_token' value is hmac sha1 of 'canvas-docker' using default config/security.yml encryption_key value as secret 21 | psql -U canvas -d canvas_development -c "INSERT INTO access_tokens (created_at, crypted_token, developer_key_id, purpose, token_hint, updated_at, user_id) SELECT now(), '4bb5b288bb301d3d4a691ebff686fc67ad49daa8', dk.id, 'canvas-docker', '', now(), 1 FROM developer_keys dk where dk.email = 'canvas@example.edu';" 22 | -------------------------------------------------------------------------------- /assets/development-local.rb: -------------------------------------------------------------------------------- 1 | config.cache_classes = true 2 | config.action_controller.perform_caching = true 3 | config.action_view.cache_template_loading = true 4 | -------------------------------------------------------------------------------- /assets/outgoing_mail.yml: -------------------------------------------------------------------------------- 1 | development: 2 | delivery_method: "EMAIL_DELIVERY_METHOD" 3 | address: "SMTP_ADDRESS" 4 | port: "SMTP_PORT" 5 | user_name: "SMTP_USER" 6 | password: "SMTP_PASS" 7 | domain: "example.edu" 8 | outgoing_address: "canvas@example.edu" 9 | default_name: "Instructure Canvas" 10 | openssl_verify_mode: "none" 11 | -------------------------------------------------------------------------------- /assets/pg_hba.conf: -------------------------------------------------------------------------------- 1 | # TYPE DATABASE USER ADDRESS METHOD 2 | 3 | # "local" is for Unix domain socket connections only 4 | local all all trust 5 | 6 | # local network connections 7 | host all all 127.0.0.1/32 trust 8 | 9 | # all remote connections from ips in docker's default netmask 10 | host all all 172.17.0.0/16 trust -------------------------------------------------------------------------------- /assets/redis.yml: -------------------------------------------------------------------------------- 1 | test: 2 | servers: 3 | - "redis://localhost" 4 | database: 1 5 | 6 | development: 7 | servers: 8 | - "redis://localhost" 9 | 10 | -------------------------------------------------------------------------------- /assets/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | sed -i "s/EMAIL_DELIVERY_METHOD/${EMAIL_DELIVERY_METHOD-test}/" /opt/canvas/canvas-lms/config/outgoing_mail.yml 6 | sed -i "s/SMTP_ADDRESS/${SMTP_ADDRESS-localhost}/" /opt/canvas/canvas-lms/config/outgoing_mail.yml 7 | sed -i "s/SMTP_PORT/${SMTP_PORT-25}/" /opt/canvas/canvas-lms/config/outgoing_mail.yml 8 | sed -i "s/SMTP_USER/${SMTP_USER-}/" /opt/canvas/canvas-lms/config/outgoing_mail.yml 9 | sed -i "s/SMTP_PASS/${SMTP_PASS-}/" /opt/canvas/canvas-lms/config/outgoing_mail.yml 10 | 11 | exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf 12 | -------------------------------------------------------------------------------- /assets/supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file=/var/run/supervisor.sock 3 | 4 | [rpcinterface:supervisor] 5 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 6 | 7 | [supervisord] 8 | nodaemon=true 9 | loglevel=debug 10 | 11 | [supervisorctl] 12 | serverurl=unix:///var/run/supervisor.sock 13 | 14 | [program:postgres] 15 | user=postgres 16 | command=/usr/lib/postgresql/9.3/bin/postgres --config-file=/etc/postgresql/9.3/main/postgresql.conf 17 | priority=1 18 | 19 | [program:redis] 20 | user=redis 21 | command=/usr/bin/redis-server --daemonize no --save "" 22 | priority=2 23 | 24 | [program:canvas_web] 25 | user=canvasuser 26 | directory=/opt/canvas/canvas-lms 27 | command=%(ENV_GEM_HOME)s/bin/bundle exec rails server -b 0.0.0.0 28 | stdout_logfile=/dev/fd/1 29 | stdout_logfile_maxbytes=0 30 | redirect_stderr=true 31 | 32 | [program:canvas_worker] 33 | user=canvasuser 34 | directory=/opt/canvas/canvas-lms 35 | command=%(ENV_GEM_HOME)s/bin/bundle exec script/delayed_job run 36 | -------------------------------------------------------------------------------- /buildspec.yml: -------------------------------------------------------------------------------- 1 | version: 0.2 2 | 3 | phases: 4 | pre_build: 5 | commands: 6 | - echo Logging in to Docker Hub... 7 | - docker login -p $DOCKER_PASS -u $DOCKER_USER 8 | - export RELEASE_TAG=`echo $REVISION | sed 's/\//-/g'` 9 | build: 10 | commands: 11 | - echo Build started on `date` 12 | - echo Building the Docker image for $REVISION ... 13 | - docker build -t lbjay/canvas-docker:$RELEASE_TAG --build-arg REVISION=$REVISION . 14 | - if [ "$LATEST" ] ; then docker tag lbjay/canvas-docker:$RELEASE_TAG lbjay/canvas-docker:latest ; fi 15 | post_build: 16 | commands: 17 | - echo Build completed on `date` 18 | - echo Pushing the Docker image for $REVISION... 19 | - docker push lbjay/canvas-docker:$RELEASE_TAG 20 | - if [ "$LATEST" ] ; then docker push lbjay/canvas-docker:latest ; fi 21 | --------------------------------------------------------------------------------