Skip to content

Commit ca19229

Browse files
committed
simplify: Use both image and build directives in compose.yml
Both directives work together: - 'docker compose up' pulls pre-built image (fast deployment) - 'docker compose build' builds locally (for customization) This is the standard Docker Compose pattern - much simpler than commenting/uncommenting directives.
1 parent b6607f2 commit ca19229

File tree

3 files changed

+6
-28
lines changed

3 files changed

+6
-28
lines changed

.github/workflows/docker-build.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,6 @@ 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-
185177
- name: Build and start services
186178
run: |
187179
docker compose build --no-cache

README.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,9 @@ 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-
```
59+
The `compose.yml` includes both `image:` and `build:` directives:
60+
- `docker compose up` - Pulls pre-built image (fast)
61+
- `docker compose build` - Builds locally (for customization)
7562

7663
## Prerequisites
7764

compose.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ services:
77
# Moodle Application (PHP 8.3 + Apache)
88
moodle:
99
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
10+
build:
11+
context: ./docker/moodle
12+
dockerfile: Dockerfile
1413
container_name: ${COMPOSE_PROJECT_NAME:-moodle45}_moodle
1514
restart: unless-stopped
1615
networks:

0 commit comments

Comments
 (0)