mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-01-06 07:30:40 +00:00
Add portainer as an optional feature
This commit is contained in:
parent
e5ce0c9a4c
commit
f85b0abac4
@ -1,5 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
- 2018-09-29 [Feature] Add [Portainer](https://portainer.io) as an optional web UI to administer docker containers
|
||||
- 2018-09-15 [Feature] Add student notes as an optional feature
|
||||
- 2018-09-15 [Feature] Add templates to configurator container, which can now be run separately
|
||||
- 2018-09-15 [Improvement] Rename "up" and "daemon" commands to "run" and "daemonize"
|
||||
|
5
Makefile
5
Makefile
@ -21,6 +21,9 @@ ifeq ($(ACTIVATE_NOTES), 1)
|
||||
extra_migrate_targets += migrate-notes
|
||||
DOCKER_COMPOSE += -f docker-compose-notes.yml
|
||||
endif
|
||||
ifeq ($(ACTIVATE_PORTAINER), 1)
|
||||
DOCKER_COMPOSE += -f docker-compose-portainer.yml
|
||||
endif
|
||||
|
||||
DOCKER_COMPOSE_RUN = $(DOCKER_COMPOSE) run --rm
|
||||
DOCKER_COMPOSE_RUN_OPENEDX = $(DOCKER_COMPOSE_RUN) -e USERID=$(USERID) -e SETTINGS=$(EDX_PLATFORM_SETTINGS)
|
||||
@ -39,7 +42,7 @@ all: configure $(post_configure_targets) update migrate assets daemonize
|
||||
configure: build-configurator
|
||||
docker run --rm -it --volume="$(PWD)/config:/openedx/config" \
|
||||
-e USERID=$(USERID) -e SILENT=$(SILENT) \
|
||||
-e SETTING_ACTIVATE_HTTPS=$(ACTIVATE_HTTPS) -e SETTING_ACTIVATE_NOTES=$(ACTIVATE_NOTES) -e SETTING_ACTIVATE_XQUEUE=$(ACTIVATE_XQUEUE) \
|
||||
-e SETTING_ACTIVATE_HTTPS=$(ACTIVATE_HTTPS) -e SETTING_ACTIVATE_NOTES=$(ACTIVATE_NOTES) -e SETTING_ACTIVATE_PORTAINER=$(ACTIVATE_PORTAINER) -e SETTING_ACTIVATE_XQUEUE=$(ACTIVATE_XQUEUE) \
|
||||
regis/openedx-configurator:hawthorn
|
||||
|
||||
stats:
|
||||
|
@ -63,6 +63,14 @@ You should beware that the `notes.<LMS_HOST>` domain name should be activated an
|
||||
|
||||
Note: in previous releases of openedx-docker, xqueue was run for all platforms. It is now an optional feature.
|
||||
|
||||
### Docker container web UI with [Portainer](https://portainer.io/) (`ACTIVATE_PORTAINER`)
|
||||
|
||||
Portainer is a web UI for managing docker containers. It lets you view your entire Open edX platform at a glace. Try it! It's really cool.
|
||||
|
||||
![Portainer demo](https://portainer.io/images/screenshots/portainer.gif)
|
||||
|
||||
After launching your platfom, the web UI will be available at [http://portainer.localhost](http://portainer.localhost) and http://portainer.YOUR_LMS_HOST. You will be asked to define a password for the admin user. Then, select a "Local environment" to work on and hit "Connect". You're done! Select the "local" group to view all running containers. Amon many other things, you'll be able to view the logs for each container, which is really useful.
|
||||
|
||||
### Android app (beta)
|
||||
|
||||
The Android app for your platform can be easily built in just one command:
|
||||
|
@ -158,6 +158,8 @@ def interactive(args):
|
||||
'ACTIVATE_NOTES', "", False
|
||||
).add_bool(
|
||||
'ACTIVATE_HTTPS', "", False
|
||||
).add_bool(
|
||||
'ACTIVATE_PORTAINER', "", False
|
||||
).add_bool(
|
||||
'ACTIVATE_XQUEUE', "", False
|
||||
).add(
|
||||
|
@ -1,2 +1,10 @@
|
||||
#!/bin/sh
|
||||
certbot certonly --standalone -n --agree-tos -m admin@{{ LMS_HOST }} -d {{ LMS_HOST }} -d {{ CMS_HOST }} -d preview.{{ LMS_HOST }} {% if ACTIVATE_NOTES %} -d notes.{{ LMS_HOST }}{% endif %}
|
||||
certbot certonly --standalone -n --agree-tos -m admin@{{ LMS_HOST }} -d {{ LMS_HOST }} -d {{ CMS_HOST }} -d preview.{{ LMS_HOST }}
|
||||
|
||||
{% if ACTIVATE_NOTES %}
|
||||
certbot certonly --standalone -n --agree-tos -m admin@{{ LMS_HOST }} -d notes.{{ LMS_HOST }}
|
||||
{% endif %}
|
||||
|
||||
{% if ACTIVATE_PORTAINER %}
|
||||
certbot certonly --standalone -n --agree-tos -m admin@{{ LMS_HOST }} -d portainer.{{ LMS_HOST }}
|
||||
{% endif %}
|
||||
|
71
configurator/templates/nginx/extra.conf
Normal file
71
configurator/templates/nginx/extra.conf
Normal file
@ -0,0 +1,71 @@
|
||||
{% if ACTIVATE_NOTES %}
|
||||
{% if ACTIVATE_HTTPS %}
|
||||
server {
|
||||
server_name notes.{{ LMS_HOST }};
|
||||
listen 80;
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
server {
|
||||
listen {{ "443 ssl" if ACTIVATE_HTTPS else "80" }};
|
||||
server_name notes.localhost notes.{{ LMS_HOST }};
|
||||
|
||||
{% if ACTIVATE_HTTPS %}
|
||||
ssl_certificate /etc/letsencrypt/live/notes.{{ LMS_HOST }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/notes.{{ LMS_HOST }}/privkey.pem;
|
||||
{% endif %}
|
||||
|
||||
# Disables server version feedback on pages and in headers
|
||||
server_tokens off;
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
|
||||
# Docker resolver
|
||||
resolver 127.0.0.11 valid=10s;
|
||||
set $upstream notes;
|
||||
proxy_pass http://$upstream:8000;
|
||||
}
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% if ACTIVATE_PORTAINER %}
|
||||
{% if ACTIVATE_HTTPS %}
|
||||
server {
|
||||
server_name portainer.{{ LMS_HOST }};
|
||||
listen 80;
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
server {
|
||||
listen {{ "443 ssl" if ACTIVATE_HTTPS else "80" }};
|
||||
server_name portainer.localhost portainer.{{ LMS_HOST }};
|
||||
|
||||
{% if ACTIVATE_HTTPS %}
|
||||
ssl_certificate /etc/letsencrypt/live/portainer.{{ LMS_HOST }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/portainer.{{ LMS_HOST }}/privkey.pem;
|
||||
{% endif %}
|
||||
|
||||
# Disables server version feedback on pages and in headers
|
||||
server_tokens off;
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
|
||||
# Docker resolver
|
||||
resolver 127.0.0.11 valid=10s;
|
||||
set $upstream portainer;
|
||||
proxy_pass http://$upstream:9000;
|
||||
}
|
||||
}
|
||||
{% endif %}
|
@ -1,33 +0,0 @@
|
||||
{% if ACTIVATE_HTTPS %}
|
||||
server {
|
||||
server_name notes.{{ LMS_HOST }};
|
||||
listen 80;
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
server {
|
||||
listen {{ "443 ssl" if ACTIVATE_HTTPS else "80" }};
|
||||
server_name notes.localhost notes.{{ LMS_HOST }};
|
||||
|
||||
{% if ACTIVATE_HTTPS %}
|
||||
ssl_certificate /etc/letsencrypt/live/notes.{{ LMS_HOST }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/notes.{{ LMS_HOST }}/privkey.pem;
|
||||
{% endif %}
|
||||
|
||||
# Disables server version feedback on pages and in headers
|
||||
server_tokens off;
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
|
||||
# Docker resolver
|
||||
resolver 127.0.0.11 valid=10s;
|
||||
set $upstream notes;
|
||||
proxy_pass http://$upstream:8000;
|
||||
}
|
||||
}
|
1
data/.gitignore
vendored
1
data/.gitignore
vendored
@ -7,5 +7,6 @@ lms_worker/
|
||||
elasticsearch/
|
||||
mysql/
|
||||
mongodb/
|
||||
portainer/
|
||||
rabbitmq/
|
||||
xqueue/
|
||||
|
12
docker-compose-portainer.yml
Normal file
12
docker-compose-portainer.yml
Normal file
@ -0,0 +1,12 @@
|
||||
version: "3"
|
||||
services:
|
||||
|
||||
############# Portainer: container supervision with a web UI
|
||||
portainer:
|
||||
image: portainer/portainer:latest
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./data/portainer:/data
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- nginx
|
Loading…
Reference in New Issue
Block a user