Coder Social home page Coder Social logo

jimsihk / alpine-moodle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from erseco/alpine-moodle

0.0 0.0 0.0 456 KB

Moodle docker image based on Alpine Linux, NGINX, PHP-FPM and official Moodle

Home Page: https://hub.docker.com/r/jimsihk/alpine-moodle

License: MIT License

Shell 87.00% PHP 1.03% Dockerfile 11.97%
alpine amd64 arm64 armv7 docker moodle nginx php8

alpine-moodle's People

Contributors

erseco avatar jimsihk avatar renovate[bot] avatar

alpine-moodle's Issues

Setup for running behind Nginx Proxy Manager

Hi
I am trying to run this container behind Nginx Proxy Manager, mainly for automation of SSL and https installation.
Any advice regarding ENV variables and ports setup in docker-compose file?
Thanks

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: renovate.json
Error type: Invalid JSON (parsing failed)
Message: Syntax error: expecting end of expression or separator near p" "pack

No CSS when changing Moodle port #

Hi, thank you for sharing your work.

Not sure if this is a bug, but more of a question. Why doesn't my site load the CSS when I change the Moodle port in the .yml file? For example, instead of port 80, I am trying 3000:

ports:
      - 3000:8080

and the result is like this:
image

Rest of the .yml file is the same. And when I revert the port # back to 80, then the Moodle site works

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

docker-compose
docker-compose.replica.yml
docker-compose.test.yml
docker-compose.yml
dockerfile
Dockerfile
  • quay.io/jimsihk/alpine-php-nginx 82.16.0
github-actions
.github/workflows/auto-release.yml
  • tibdex/github-app-token v2
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • tj-actions/changed-files v42
  • ncipollo/release-action v1
.github/workflows/build.yml
  • actions/checkout v4
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/login-action v3
  • github/codeql-action v3
  • anchore/scan-action v3
  • github/codeql-action v3
  • tj-actions/changed-files v42
  • docker/build-push-action v5
  • docker/build-push-action v5
.github/workflows/nightly.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • docker/login-action v3
  • docker/build-push-action v5
.github/workflows/scan.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • aquasecurity/trivy-action 0.17.0
  • github/codeql-action v3
  • anchore/scan-action v3
  • github/codeql-action v3
.github/workflows/test-pr.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/build-push-action v5
  • aquasecurity/trivy-action 0.17.0
  • anchore/scan-action v3
.github/workflows/update-dockerhub-desc.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • peter-evans/dockerhub-description v4
regex
Dockerfile
  • https://github.com/moodle/moodle MOODLE_403_STABLE@994a21d4ff73ba493b90b3ec54bedab5caa13389
  • https://github.com/catalyst/moodle-cachestore_redissentinel master@b495e8f36a81fd1a2a414e34a978da879c473f31
  • https://github.com/moodlehq/moodle-cachestore_memcached master@db68d31ab5856cb55210478fdd452dc0cd6c6d05
Dockerfile
  • alpine_3_19/dcron 4.5-r9
  • alpine_3_19/libcap 2.69-r1
  • alpine_3_19/git 2.43.0-r0
  • alpine_3_19/bash 5.2.21-r0

  • Check this box to trigger a request for Renovate to run again on this repository

Moodle behind Traefik

Hi,

No matter what I try, I cannot get Traefik working with Moodle. I set up a docker compose with Traefik and Alpine-Moodle.

All I get is a Gateway Timeout error. I have made sure Traefik and Alpine-Moodle are in the same docker network and I am able to CURL the Alpine-Moodle site just fine from the Traefik container.

I also have tried using alpine-php-nginx with a basic hello proxied trough Traefik, but without success. I have other containers proxied trough Traefik that work fine, so I doubt the problem is in my Traefik configuration.

Could you help me get my Traefik to proxy Moodle?

traefik compose

version: "3.5"
services:
traefik:
  container_name: traefik
  image: "traefik:latest"
  command:
    - --providers.docker
  ports:
    - "80:80"
    - "443:443"
  volumes:
    - "/var/run/docker.sock:/var/run/docker.sock:ro"
    - "/etc/traefik:/etc/traefik"
  networks:
    - web
  labels:
  - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
  - "traefik.http.routers.http-catchall.entrypoints=web"
  - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
  - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
  - "traefik.enable=true"
  - "traefik.http.routers.dashboard.rule=Host(`dash.mydomain.com`)"
  - "traefik.http.routers.dashboard.entrypoints=websecure"
  - "traefik.http.services.dashboard.loadbalancer.server.port=8080"
  - "traefik.http.routers.dashboard.service=dashboard"
  - "traefik.http.routers.dashboard.tls.certresolver=production"

networks:
  web:
    name: web
    driver: bridge

moodle compose

version: '2'
services:

  postgres:
    image: postgres:alpine
    restart: unless-stopped
    networks:
      - default
    environment:
      - POSTGRES_PASSWORD=moodle
      - POSTGRES_USER=moodle
      - POSTGRES_DB=moodle
    volumes:
      - postgres:/var/lib/postgresql/data

  moodle:
    image: jimsihk/alpine-moodle
    build: .
    restart: unless-stopped
    networks:
      - default
      - web
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.moodle.rule=Host(`mydomain.com`)"
      - "traefik.http.routers.moodle.entrypoints=websecure"
      - "traefik.http.routers.moodle.tls=true"
      - "traefik.http.routers.moodle.tls.certresolver=production"
      - "traefik.http.routers.moodle.service=moodleapp"
      - "traefik.http.services.moodleapp.loadbalancer.server.port=8080"
    environment:
      - LANG=en_US.UTF-8
      - LANGUAGE=en_US:en
      - SITE_URL=https://mydomain.com
      - DB_TYPE=pgsql
      - DB_HOST=postgres
      - DB_PORT=5432
      - DB_NAME=moodle
      - DB_USER=moodle
      - DB_PASS=moodle
      - DB_PREFIX=mdl_
      - SSLPROXY=true
      - [email protected]
      - MOODLE_LANGUAGE=en
      - MOODLE_SITENAME=New-Site
      - MOODLE_USERNAME=moodleuser
      - MOODLE_PASSWORD=PLEASE_CHANGEME
      - SMTP_HOST=smtp.gmail.com
      - SMTP_PORT=587
      - [email protected]
      - SMTP_PASSWORD=your_password \
      - SMTP_PROTOCOL=tls
      - MOODLE_MAIL_NOREPLY_ADDRESS=noreply@localhost
      - MOODLE_MAIL_PREFIX=[moodle]
      - SESSION_CACHE_TYPE=database
      - SESSION_CACHE_HOST=postgres
      - SESSION_CACHE_PORT=5432
      - SESSION_CACHE_PREFIX=mdl
      - AUTO_UPDATE_MOODLE=true
    ports:
      - 8080:8080
    volumes:
      - moodledata:/var/www/moodledata
      - moodlehtml:/var/www/html
    depends_on:
      - postgres

volumes:
  postgres: null
  moodledata: null
  moodlehtml: null
  
networks:
  default:
    internal: true
  web:
    external: true

Traefik config

global:
  checkNewVersion: true
  sendAnonymousUsage: false

api:
 dashboard: true
 insecure: true

entryPoints:
  web:
    address: :80
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https

  websecure:
    address: :443

certificatesResolvers:
  staging:
    acme:
      email: [email protected]
      storage: /etc/traefik/certs/acme.json
      caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
      httpChallenge:
        entryPoint: web

  production:
    acme:
      email: [email protected]
      storage: /etc/traefik/certs/acme.json
      caServer: "https://acme-v02.api.letsencrypt.org/directory"
      httpChallenge:
        entryPoint: web

providers:
  docker:
    exposedByDefault: false
  file:
    directory: /etc/traefik
    watch: true

Question about persistent storage

Thanks for this image / work.

I'm trying to migrate to this project from Bitnami and have a question about your use of nobody and volumes. Specifically, Bitnami uses the convention of explicit mounts for volume persistence.

- /path/to/moodle-persistence:/bitnami/moodle

As I am trying to preserve the existing data, I'm attempting to map to your structure, however your use of implicit storage is making that a challenge. I have tried to adjust your docker-compose such that I do something like:

- ./moodledata:/var/www/moodledata
- ./moodlehtml:/var/www/html

with ownership of those folders as nobody (65534). When doing so, the container fails to startup.

I'd appreciate any insight you may be able to provide.
I've tried a couple things:

  • explicit user in docker-compose
  • PUID & GUID env variables
  • adding :rw to the volume maps
  • chmod 777 on the voume folders as a debug effort

but none of them allow the container to write to the mapped volume.

Once I know I can get the container launched I can (hopefully) align the data movement.

Many thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.