6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-11-11 15:51:00 +00:00

Move portainer to a dedicated make command

Portainer is no longer a global activation flag, because it does not
make much sense in the context of kubernetes. Instead, we use a simpler
"make" command.
This commit is contained in:
Régis Behmo 2018-12-26 18:43:00 +01:00 committed by Régis Behmo
parent a81593f6a8
commit eab812b63d
8 changed files with 26 additions and 64 deletions

View File

@ -173,8 +173,6 @@ def interactive_configuration(config_path):
'ACTIVATE_HTTPS', False, "Activate SSL/TLS certificates for HTTPS access? Important note: this will NOT work in a development environment.", 'ACTIVATE_HTTPS', False, "Activate SSL/TLS certificates for HTTPS access? Important note: this will NOT work in a development environment.",
).add_bool( ).add_bool(
'ACTIVATE_NOTES', False, "Activate Student Notes service (https://open.edx.org/features/student-notes)?", 'ACTIVATE_NOTES', False, "Activate Student Notes service (https://open.edx.org/features/student-notes)?",
).add_bool(
'ACTIVATE_PORTAINER', False, "Activate Portainer, a convenient Docker dashboard with a web UI (https://portainer.io)?",
).add_bool( ).add_bool(
'ACTIVATE_XQUEUE', False, "Activate Xqueue for external grader services? (https://github.com/edx/xqueue)", 'ACTIVATE_XQUEUE', False, "Activate Xqueue for external grader services? (https://github.com/edx/xqueue)",
).add( ).add(

View File

@ -168,6 +168,14 @@ import-demo-course: ## Import the demo course from edX
create-staff-user: ## Create a user with admin rights create-staff-user: ## Create a user with admin rights
$(DOCKER_COMPOSE_RUN_OPENEDX) lms /bin/bash -c "./manage.py lms manage_user --superuser --staff ${USERNAME} ${EMAIL} && ./manage.py lms changepassword ${USERNAME}" $(DOCKER_COMPOSE_RUN_OPENEDX) lms /bin/bash -c "./manage.py lms manage_user --superuser --staff ${USERNAME} ${EMAIL} && ./manage.py lms changepassword ${USERNAME}"
portainer: ## Run Portainer (https://portainer.io), a UI for container supervision
docker run --rm -it \
--volume=/var/run/docker.sock:/var/run/docker.sock \
--volume=$(PWD)/../../data/portainer:/data \
-p 9000:9000 \
portainer/portainer:latest
@echo "View the Portainer UI at http://localhost:9000"
##################### Information ##################### Information
# Obtained by running "echo '\033' in a shell # Obtained by running "echo '\033' in a shell

View File

@ -187,15 +187,3 @@ services:
depends_on: depends_on:
- mysql - mysql
{% endif %} {% endif %}
{% if ACTIVATE_PORTAINER %}
############# 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
{% endif %}

View File

@ -4,7 +4,3 @@ certbot certonly --standalone -n --agree-tos -m admin@{{ LMS_HOST }} -d {{ LMS_H
{% if ACTIVATE_NOTES %} {% if ACTIVATE_NOTES %}
certbot certonly --standalone -n --agree-tos -m admin@{{ LMS_HOST }} -d notes.{{ LMS_HOST }} certbot certonly --standalone -n --agree-tos -m admin@{{ LMS_HOST }} -d notes.{{ LMS_HOST }}
{% endif %} {% endif %}
{% if ACTIVATE_PORTAINER %}
certbot certonly --standalone -n --agree-tos -m admin@{{ LMS_HOST }} -d portainer.{{ LMS_HOST }}
{% endif %}

View File

@ -33,39 +33,3 @@ server {
} }
} }
{% endif %} {% 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 %}

View File

@ -96,6 +96,22 @@ The course search index can be updated with::
Run this command periodically to ensure that course search results are always up-to-date. Run this command periodically to ensure that course search results are always up-to-date.
.. _portainer:
Docker container web UI with `Portainer <https://portainer.io/>`_
-----------------------------------------------------------------
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::
make portainer
.. .. image:: https://portainer.io/images/screenshots/portainer.gif
..:alt: Portainer demo
After launching your platfom, the web UI will be available at `http://localhost:9000 <http://localhost:9000>`_. You will be asked to define a password for the admin user. Then, select a "Local environment" to work on and hit "Connect" and select the "local" group to view all running containers.
Among many other things, you'll be able to view the logs for each container, which is really useful.
Additional commands Additional commands
------------------- -------------------

View File

@ -41,16 +41,6 @@ Xqueue
`Xqueue <https://github.com/edx/xqueue>`_ is for grading problems with external services. If you don't know what it is, you probably don't need it. `Xqueue <https://github.com/edx/xqueue>`_ is for grading problems with external services. If you don't know what it is, you probably don't need it.
Docker container web UI with `Portainer <https://portainer.io/>`_
-----------------------------------------------------------------
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.
.. image:: https://portainer.io/images/screenshots/portainer.gif
:alt: Portainer demo
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) Android app (beta)
------------------ ------------------

View File

@ -27,6 +27,8 @@ The last commands produce the logs since the creation of the containers, which c
docker-compose logs --tail=0 -f docker-compose logs --tail=0 -f
If you'd rather use a graphical user interface for viewing logs, you are encouraged to try out :ref:`Portainer <portainer>`.
"Cannot start service nginx: driver failed programming external connectivity" "Cannot start service nginx: driver failed programming external connectivity"
----------------------------------------------------------------------------- -----------------------------------------------------------------------------