Skip to content
This repository was archived by the owner on May 25, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
08c761c
Updating name.
jmhardison Jan 5, 2018
f095f5f
Merge pull request #17 from jmhardison/update-name
jmhardison Jan 5, 2018
9cec1a2
Update to 3.4
jmhardison Jan 5, 2018
f28df9b
Merge pull request #18 from jmhardison/moodle3-4
jmhardison Jan 5, 2018
ddab5fa
updating readme file.
jmhardison Jan 5, 2018
22da552
Merge pull request #19 from jmhardison/readme-update
jmhardison Jan 5, 2018
f6ebd49
wording update
jmhardison Jan 5, 2018
9f88ad6
Merge pull request #20 from jmhardison/update-readme-again
jmhardison Jan 5, 2018
03b5f54
le update
jmhardison Jan 5, 2018
01b8422
Merge pull request #21 from jmhardison/readme-update-3
jmhardison Jan 5, 2018
4a6b580
Update README.md
jmhardison Jan 5, 2018
c9123c0
Merge pull request #22 from jmhardison/jmhardison-patch-1
jmhardison Jan 5, 2018
d14baaf
Upating to only use MySQL:5
jmhardison Apr 25, 2018
046d13a
Merge pull request #23 from jmhardison/update-lockmysql5
jmhardison Apr 25, 2018
4951091
updating for 3.5
jmhardison May 16, 2018
b784280
Merge pull request #24 from jmhardison/v3-5
jmhardison May 17, 2018
531f513
Changes to use ubuntu 18.04 base.
jmhardison Jul 11, 2018
3be2678
Merge pull request #25 from jmhardison/18_04
jmhardison Jul 11, 2018
53f80df
Updated label to "LABEL" from "MAINTAINER"
Sep 12, 2018
575ad38
changed CMD to ENTRYPOINT, freeing for possible future arguments.
Sep 12, 2018
7ce9e97
Changed to ADD for consistency.
Sep 12, 2018
d41378c
update readme
jmhardison Sep 12, 2018
50a84ec
Merge pull request #26 from jmhardison/updatelabels
jmhardison Sep 12, 2018
c23e96f
Work with SSL reverse proxy
Sep 20, 2018
453cdac
Correct default value for SSL_PROXY
Sep 20, 2018
42cb0c4
Set up CI with Azure Pipelines
azure-pipelines[bot] Sep 27, 2018
ff7f342
Update azure-pipelines.yml
jmhardison Sep 27, 2018
7a83631
Merge pull request #27 from robsonmantovani/master
jmhardison Oct 1, 2018
6579a46
Merge pull request #28 from jmhardison/azure-pipelines
jmhardison Oct 1, 2018
05bbe0f
Update issue templates
jmhardison Oct 1, 2018
5d3c69a
Added templates and code of conduct.
jmhardison Oct 1, 2018
cf3f5d1
Merge pull request #29 from jmhardison/tempaltes_coc
jmhardison Oct 1, 2018
73c26e5
adding badge
jmhardison Oct 2, 2018
c3ab7ae
Merge pull request #30 from jmhardison/addbadge
jmhardison Oct 2, 2018
d339e1b
Update README deploy information
Oct 31, 2018
d514934
Merge pull request #31 from robsonmantovani/master
jmhardison Oct 31, 2018
fc9df69
Version Push 3.6
koelle25 Dec 5, 2018
8e8d2f1
Merge pull request #33 from koelle25/master
jmhardison Dec 5, 2018
d983f93
rolled up to moodle 3.7 and ubuntu 19.04
jmhardison Jun 18, 2019
93f394e
Merge pull request #36 from jmhardison/updateto37
jmhardison Jun 18, 2019
18f13c3
bumped 3.8
jmhardison Jan 30, 2020
bf6e50b
Merge pull request #40 from jmhardison/update_38
jmhardison Jan 30, 2020
07c7e82
20.04 image source
jmhardison May 7, 2020
91c9e55
Merge pull request #42 from jmhardison/update-20-04
jmhardison May 7, 2020
d3cee90
Create docker-image.yml
jmhardison Sep 2, 2020
4b3d8ac
Upgrade to GitHub-native Dependabot
dependabot-preview[bot] Apr 29, 2021
4d5e5f2
Merge pull request #43 from jmhardison/dependabot/add-v2-config-file
jmhardison Jun 19, 2021
e1aef96
Modified for 3.11
jmhardison Oct 7, 2021
21d4d97
update loop
jmhardison Oct 7, 2021
3440852
error &&
jmhardison Oct 7, 2021
82eb771
adding githubaction changes
jmhardison Oct 7, 2021
1b2ea0b
Merge pull request #44 from jmhardison/v3-11
jmhardison Oct 7, 2021
85e5b38
Update README.md
jmhardison Oct 7, 2021
2006f00
Update README.md
jmhardison Oct 7, 2021
95042be
modifications to pipelines adding snyk
jmhardison Oct 7, 2021
1655d10
name changes
jmhardison Oct 7, 2021
ffb4454
removed typo
jmhardison Oct 7, 2021
144bf47
remove date
jmhardison Oct 7, 2021
9119583
Merge pull request #45 from jmhardison/adjust-actions
jmhardison Oct 7, 2021
99299b7
Bump docker/metadata-action from 3.3.0 to 3.5.0
dependabot[bot] Oct 7, 2021
42cc4f4
Merge pull request #46 from jmhardison/dependabot/github_actions/dock…
jmhardison Oct 8, 2021
ac82c7a
Update README.md
jmhardison Oct 9, 2021
d0e458d
Delete azure-pipelines.yml
jmhardison Oct 9, 2021
620ab29
Bump docker/metadata-action from 3.5.0 to 3.6.0
dependabot[bot] Oct 25, 2021
4e9c86a
Merge pull request #47 from jmhardison/dependabot/github_actions/dock…
jmhardison Nov 2, 2021
e173f4e
Bump docker/metadata-action from 3.6.0 to 3.6.1
dependabot[bot] Nov 30, 2021
1cba65f
Merge pull request #48 from jmhardison/dependabot/github_actions/dock…
jmhardison Nov 30, 2021
e104b73
Bump docker/metadata-action from 3.6.1 to 3.6.2
dependabot[bot] Dec 7, 2021
a6cbac1
Bump docker/login-action from 1.10.0 to 1.12.0
dependabot[bot] Dec 21, 2021
9568052
Merge pull request #51 from jmhardison/dependabot/github_actions/dock…
jmhardison Feb 15, 2022
528a396
Merge pull request #49 from jmhardison/dependabot/github_actions/dock…
jmhardison Feb 15, 2022
1a738e9
Bump actions/checkout from 2 to 3
dependabot[bot] Mar 2, 2022
f70b9cc
Bump docker/build-push-action from 2 to 3
dependabot[bot] May 6, 2022
75eb14a
Bump docker/login-action from 1.12.0 to 2
dependabot[bot] May 6, 2022
8284d0a
Bump docker/metadata-action from 3.6.2 to 4.0.1
dependabot[bot] May 6, 2022
5dd1373
Merge pull request #54 from jmhardison/dependabot/github_actions/acti…
jmhardison Jun 22, 2022
43f9bbf
Merge pull request #61 from jmhardison/dependabot/github_actions/dock…
jmhardison Jun 22, 2022
4d5efd7
Merge pull request #62 from jmhardison/dependabot/github_actions/dock…
jmhardison Jun 22, 2022
a51ef95
Merge pull request #63 from jmhardison/dependabot/github_actions/dock…
jmhardison Jun 22, 2022
0d8e876
update to moodle 4.0
jmhardison Oct 8, 2022
a43448a
update readme
jmhardison Oct 8, 2022
de5c17a
Merge pull request #64 from jmhardison/updaterun-2022
jmhardison Oct 8, 2022
b011923
Bump docker/login-action from 2.0.0 to 2.1.0
dependabot[bot] Oct 12, 2022
c4a78f1
Bump docker/metadata-action from 4.0.1 to 4.1.1
dependabot[bot] Oct 18, 2022
5d6a49f
Merge pull request #67 from jmhardison/dependabot/github_actions/dock…
jmhardison Dec 4, 2022
a053fb3
Merge pull request #65 from jmhardison/dependabot/github_actions/dock…
jmhardison Dec 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team through GitHub. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
43 changes: 43 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Contributing

Hello there! Glad you want to contribute to the Docker-Moodle project! This document will help answer common questions you may have during your first contribution.

## Code of Conduct

This repository adopts the Contributor Covenant Code of Conduct and should be reviewed before contributing.

## Submitting Issues

Not every contribution comes in the form of code. Submitting, confirming, and triaging issues is an important task for any project.

Issues submitted to this repository are only for the docker image it represents. Issues for the underlying software `moodle` need to be submitted through the [Moodle Tracker.](https://tracker.moodle.org/secure/Dashboard.jspa)

## Commit Signing Required

This repository requires commits to be signed. For more informaiton on configuring your local client for this, please reference the following:

1. [Git - Got-Tools-Signing-Your-Work](https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work)
2. [Github - Signing-Commits](https://help.github.com/articles/signing-commits/)
3. [Yubikey Git Signing](https://developers.yubico.com/PGP/Git_signing.html)

## Contribution Process

The following are the general steps for a contribution:

1. Commit changes to a git branch, making sure to use commit signing.
2. Create a GitHub Pull Request for your change, following the instructions in the pull request template.

### Pull Request Requirements

The following requirements exist for pull requests:

1. Commits are signed.
2. PR follows template.
3. CI build and tests pass.
4. Codacy Quality Review passes.

### Code Review Process

Code review takes place in GitHub pull requests. See [this article](https://help.github.com/articles/about-pull-requests/) if you're not familiar with GitHub Pull Requests.

Once you open a pull request, a code review will take place within the files changed of your PR. An approval, comment, or request for changes will be responded on the PR to further the request.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Describe the issue**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Docker Version (please complete the following information):**
- OS: [e.g. Ubuntu or Windows]
- OS Version [e.g. 22]
- Docker Version [e.g. 18.06.1-ce]
- Tag name of image if pulled from Docker Hub. [e.g. v3.1]

**Additional context**
Add any other context about the problem here.
Production, or testing.
Deploying using an orchestrator?
Deploying behind a load balancer?
etc.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Description

[Please describe what this change achieves]

### Issues Resolved

[List any existing issues this PR resolves, link to appropriate issues or other sources.]

### Check List

- [ ] Image buildes successfully.
- [ ] Image runs and service can be opened successfully.
- [ ] All tests pass where applicable.
- [ ] README.md updated where appropriate.
- [ ] All commits have been signed.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: docker
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
27 changes: 27 additions & 0 deletions .github/workflows/docker-buildtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker PR Build and Test

on:
pull_request:
branches: [ master ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
id: docker_build
uses: docker/build-push-action@v3
with:
push: false
tags: moodle:latest

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/docker@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
image: moodle:latest
44 changes: 44 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Docker Release
on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea
with:
images: |
jhardison/moodle
ghcr.io/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
26 changes: 13 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Docker-Moodle
# Dockerfile for moodle instance. more dockerish version of https://github.com/sergiogomez/docker-moodle
# Forked from Jon Auer's docker version. https://github.com/jda/docker-moodle
FROM ubuntu:16.04
MAINTAINER Jonathan Hardison <jmh@jonathanhardison.com>
# Forked from Jade Auer's docker version. https://github.com/jda/docker-moodle
FROM ubuntu:20.04
LABEL maintainer="Jonathan Hardison <jmh@jonathanhardison.com>"

VOLUME ["/var/moodledata"]
EXPOSE 80 443
COPY moodle-config.php /var/www/html/config.php

# Keep upstart from complaining
# RUN dpkg-divert --local --rename --add /sbin/initctl
# RUN ln -sf /bin/true /sbin/initctl

# Let the container know that there is no tty
ENV DEBIAN_FRONTEND noninteractive

# Database info and other connection information derrived from env variables. See readme.
# Set ENV Variables externally Moodle_URL should be overridden.
ENV MOODLE_URL http://127.0.0.1

ADD ./foreground.sh /etc/apache2/foreground.sh
# Enable when using external SSL reverse proxy
# Default: false
ENV SSL_PROXY false

COPY ./foreground.sh /etc/apache2/foreground.sh

RUN apt-get update && \
RUN apt-get update && apt-get upgrade -y && \
apt-get -y install mysql-client pwgen python-setuptools curl git unzip apache2 php \
php-gd libapache2-mod-php postfix wget supervisor php-pgsql curl libcurl3 \
libcurl3-dev php-curl php-xmlrpc php-intl php-mysql git-core php-xml php-mbstring php-zip php-soap cron php7.0-ldap && \
php-gd libapache2-mod-php postfix wget supervisor php-pgsql curl libcurl4 \
libcurl3-dev php-curl php-xmlrpc php-intl php-mysql git-core php-xml php-mbstring php-zip php-soap cron php-ldap && \
cd /tmp && \
git clone -b MOODLE_33_STABLE git://git.moodle.org/moodle.git --depth=1 && \
git clone -b MOODLE_400_STABLE git://git.moodle.org/moodle.git --depth=1 && \
mv /tmp/moodle/* /var/www/html/ && \
rm /var/www/html/index.html && \
chown -R www-data:www-data /var/www/html && \
Expand All @@ -42,4 +42,4 @@ RUN a2enmod ssl && a2ensite default-ssl #if using proxy dont need actually secu
# Cleanup, this is ran to reduce the resulting size of the image.
RUN apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/lib/dpkg/* /var/lib/cache/* /var/lib/log/*

CMD ["/etc/apache2/foreground.sh"]
ENTRYPOINT ["/etc/apache2/foreground.sh"]
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
docker-moodle
=============
[![](https://images.microbadger.com/badges/image/jhardison/moodle.svg)](https://microbadger.com/images/jhardison/moodle "Get your own image badge on microbadger.com")
[![Docker Release](https://github.com/jmhardison/docker-moodle/actions/workflows/docker-release.yml/badge.svg)](https://github.com/jmhardison/docker-moodle/actions/workflows/docker-release.yml)

A Dockerfile that installs and runs the latest Moodle 3.3 stable, with external MySQL Database.
Cross published at [github.](https://github.com/jmhardison/docker-moodle/pkgs/container/docker-moodle)

A Dockerfile that installs and runs the latest Moodle stable, with external MySQL Database.

`Note: DB Deployment uses version 5 of MySQL. MySQL:Latest is now v8.`

Tags:
* latest - 3.3 stable
* latest - 4.0 stable
* v4.0 - 4.0 stable
* v3.11 - 3.11 stable
* v3.8 - 3.8 stable
* v3.7 - 3.7 stable
* v3.6 - 3.6 stable
* v3.5 - 3.5 stable
* v3.4 - 3.4 stable
* v3.3 - 3.3 stable
* v3.2 - 3.2 stable
* v3.1 - 3.1 stable

Expand All @@ -26,7 +38,7 @@ When running locally or for a test deployment, use of localhost is acceptable.
To spawn a new instance of Moodle:

```
docker run -d --name DB -p 3306:3306 -e MYSQL_DATABASE=moodle -e MYSQL_ROOT_PASSWORD=moodle -e MYSQL_USER=moodle -e MYSQL_PASSWORD=moodle mysql
docker run -d --name DB -p 3306:3306 -e MYSQL_DATABASE=moodle -e MYSQL_ROOT_PASSWORD=moodle -e MYSQL_USER=moodle -e MYSQL_PASSWORD=moodle mysql:5
docker run -d -P --name moodle --link DB:DB -e MOODLE_URL=http://localhost:8080 -p 8080:80 jhardison/moodle
```

Expand All @@ -41,9 +53,11 @@ http://localhost:8080
For a production deployment of moodle, use of a FQDN is advised. This FQDN should be created in DNS for resolution to your host. For example, if your internal DNS is company.com, you could leverage moodle.company.com and have that record resolve to the host running your moodle container. The moodle url would then be, `MOODLE_URL=http://moodle.company.com`
In the following steps, replace MOODLE_URL with your appropriate FQDN.

In some cases when you are using an external SSL reverse proxy, you should enable `SSL_PROXY=true` variable.

* Deploy With Docker
```
docker run -d --name DB -p 3306:3306 -e MYSQL_DATABASE=moodle -e MYSQL_ROOT_PASSWORD=moodle -e MYSQL_USER=moodle -e MYSQL_PASSWORD=moodle mysql
docker run -d --name DB -p 3306:3306 -e MYSQL_DATABASE=moodle -e MYSQL_ROOT_PASSWORD=moodle -e MYSQL_USER=moodle -e MYSQL_PASSWORD=moodle mysql:5
docker run -d -P --name moodle --link DB:DB -e MOODLE_URL=http://moodle.company.com -p 80:80 jhardison/moodle
```

Expand All @@ -69,6 +83,5 @@ The following aren't handled, considered, or need work:

## Credits

This is a fork of [Jon Auer's](https://github.com/jda/docker-moodle) Dockerfile.
This is a fork of [Jade Auer's](https://github.com/jda/docker-moodle) Dockerfile.
This is a reductionist take on [sergiogomez](https://github.com/sergiogomez/)'s docker-moodle Dockerfile.

6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
dbapp:
image: mysql:latest
image: mysql:5
restart: always
volumes:
- db-volume:/var/lib/mysql
Expand All @@ -13,7 +13,7 @@ services:
deploy:
replicas: 1
restart_policy:
condition: any
condition: on-failure
moodleapp:
image: jhardison/moodle:latest
links:
Expand All @@ -34,7 +34,7 @@ services:
deploy:
replicas: 1
restart_policy:
condition: any
condition: on-failure

volumes:
db-volume:
Expand Down
Loading