Skip to content

Commit b6607f2

Browse files
committed
refactor: Use pre-built GHCR image by default in compose.yml
- Changed compose.yml to use ghcr.io/netresearch/moodle-docker/moodle:latest - Commented out build directive (can be uncommented for local builds) - Updated README quick start to reflect image pull workflow - Added local build instructions for customization - Updated CI workflow to switch to local build for testing Benefits: - Faster deployment (no build time required) - Consistent images across deployments - Still supports local builds when needed
1 parent 5cdcf2b commit b6607f2

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

.github/workflows/docker-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ jobs:
174174
sed -i 's/CHANGE_ME_SECURE_ROOT_PASSWORD_HERE/test_root_456/g' .env
175175
sed -i 's/CHANGE_ME_SECURE_VALKEY_PASSWORD_HERE/test_valkey_789/g' .env
176176
177+
- name: Configure for local build
178+
run: |
179+
# Use local build instead of pulling from GHCR for testing
180+
sed -i 's|image: ghcr.io/netresearch/moodle-docker/moodle:latest|# image: ghcr.io/netresearch/moodle-docker/moodle:latest|' compose.yml
181+
sed -i 's|# build:|build:|' compose.yml
182+
sed -i 's|# context: ./docker/moodle| context: ./docker/moodle|' compose.yml
183+
sed -i 's|# dockerfile: Dockerfile| dockerfile: Dockerfile|' compose.yml
184+
177185
- name: Build and start services
178186
run: |
179187
docker compose build --no-cache

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ Available tags:
5656
- `main` - Latest build from main branch
5757
- `main-<sha>` - Specific commit from main branch
5858

59+
### Building Locally
60+
61+
To build the Moodle image locally (for customization or offline use):
62+
63+
```bash
64+
# Edit compose.yml and uncomment the build section:
65+
services:
66+
moodle:
67+
# image: ghcr.io/netresearch/moodle-docker/moodle:latest
68+
build:
69+
context: ./docker/moodle
70+
dockerfile: Dockerfile
71+
72+
# Then build
73+
docker compose build
74+
```
75+
5976
## Prerequisites
6077

6178
- Docker Engine 20.10.15+
@@ -100,13 +117,10 @@ nano .env
100117
- `VALKEY_PASSWORD`: Set secure password
101118
- `MOODLE_SITE_URL`: Update for production (e.g., `https://moodle.example.com`)
102119

103-
### 3. Build and Start Services
120+
### 3. Start Services
104121

105122
```bash
106-
# Build Moodle image
107-
docker compose build
108-
109-
# Start all services
123+
# Pull pre-built image and start all services
110124
docker compose up -d
111125

112126
# Check status

compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ version: '3.8'
66
services:
77
# Moodle Application (PHP 8.3 + Apache)
88
moodle:
9-
build:
10-
context: ./docker/moodle
11-
dockerfile: Dockerfile
9+
image: ghcr.io/netresearch/moodle-docker/moodle:latest
10+
# Uncomment to build locally instead of using pre-built image:
11+
# build:
12+
# context: ./docker/moodle
13+
# dockerfile: Dockerfile
1214
container_name: ${COMPOSE_PROJECT_NAME:-moodle45}_moodle
1315
restart: unless-stopped
1416
networks:

0 commit comments

Comments
 (0)