Last active
July 12, 2024 07:28
-
-
Save developerck/658870a42a7ab2994d0c831e86a49806 to your computer and use it in GitHub Desktop.
PHP + Apache + MYSQL + phpmyadmin env for Moodle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* * * * * root docker exec moodle php /var/www/html/admin/cli/cron.php > /var/log/moodle-cron.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for localhost runing the lms /mysql / phpmyadmin | |
# lms is exposed at 80 url http://localhost | |
# phpmyadmin is exposed at 8009 http://localhost:8009 | |
# login in phpyadmin | |
# host : mysql | |
# username : root | |
# password : root | |
# code can be directly edited without build | |
# commands | |
# to run | |
# docker-compose -f docker-compose-local.yaml up -d | |
# to stop | |
# docker-compose -f docker-compose-local.yaml stop | |
# to start | |
# docker-compose -f docker-compose-local.yaml start | |
# to clean | |
# docker-compose down --rmi all -v | |
# make sure to use ssl proxy | |
version: '3.3' | |
services: | |
mysql: | |
image: 'mysql:8.4' | |
container_name: mysql | |
restart: always | |
volumes: | |
- ./mysql:/var/lib/mysql | |
command: mysqld --mysql-native-password=ON --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: lms_db | |
MYSQL_USER: lmssqluser | |
MYSQL_PASSWORD: lmssqlpw | |
expose: | |
- 3306 | |
lms: | |
container_name: lms | |
image : moodlehq/moodle-php-apache:8.2 | |
restart: always | |
ports : | |
- 8001:80 | |
- 9003:9003 | |
- 25 | |
- 465 | |
- 587 | |
expose: | |
- 8001 | |
- 9003 | |
volumes: | |
- ./moodle:/var/www/html/ | |
- ./moodledata:/var/www/data | |
depends_on: | |
- mysql | |
environment: | |
- PHP_INI-post_max_size=210M | |
- PHP_INI-upload_max_filesize=200M | |
phpmyadmin: | |
image: phpmyadmin | |
container_name: phpmyadmin | |
restart: always | |
links: | |
- mysql | |
ports: | |
- 8009:80 | |
environment: | |
- PMA_ARBITRARY=1 | |
- PMA_HOST=mysql | |
- PMA_PORT=3306 | |
networks: | |
default: | |
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
client_max_body_size 200M; | |
listen 80; | |
# return 301 https://$host$request_uri; | |
location / { | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_pass http://localhost:8001; | |
proxy_read_timeout 300; | |
} | |
} | |
# | |
#server { | |
# listen 443; | |
# server_name domain; ## actual domain | |
# ssl on; | |
# ssl_certificate /etc/nginx/certs/domain.crt; | |
# ssl_certificate_key /etc/nginx/certs/domain.key; | |
# access_log /var/log/nginx/nginx-access.log; | |
# error_log /var/log/nginx/nginx-error.log; | |
# location / { | |
# proxy_set_header Host $host; | |
# proxy_set_header X-Real-IP $remote_addr; | |
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
# proxy_set_header X-Forwarded-Proto $scheme; | |
# proxy_pass http://localhost:8001; | |
# proxy_read_timeout 300; | |
# } | |
#} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment