Skip to content

Commit d18daca

Browse files
committed
docs: update README
[no ci]
1 parent b83bc29 commit d18daca

File tree

1 file changed

+77
-2
lines changed

1 file changed

+77
-2
lines changed

README.md

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,78 @@
1-
# Drupal base image
1+
# Drupal Base Image for Docker
22

3-
This image is intended to provide a basic runtime for your Drupal projects. This was written for CI but could be used for running within your compose setup as well. Currently, the image is very similar to the [official Drupal image](https://hub.docker.com/_/drupal) except that it does not contain Drupal itself.
3+
This image provides a basic runtime for Drupal projects. It's designed for CI but is also suitable for local development environments using `docker-compose`. This image is similar to the [official Drupal image](https://hub.docker.com/_/drupal) but does not include the Drupal core files, allowing you to mount your own codebase.
4+
5+
## Image Variants
6+
7+
This repository contains two main variants of the Drupal base image:
8+
9+
- `apache-bookworm`: Based on Debian Bookworm with Apache.
10+
- `fpm-alpine`: Based on Alpine Linux with PHP-FPM.
11+
12+
Choose the image that best fits your needs. The Apache image is a good choice for a simple, all-in-one container, while the FPM image is ideal for use with a separate web server like Nginx.
13+
14+
## Usage
15+
16+
### Apache
17+
18+
The Apache image is straightforward to use. Mount your Drupal codebase to `/var/www/html` in the container.
19+
20+
Here is an example `docker-compose.yml` snippet:
21+
22+
```yaml
23+
services:
24+
drupal:
25+
image: hussainweb/drupal-base:php8.4
26+
volumes:
27+
- ./path/to/your/drupal/root:/var/www/html
28+
ports:
29+
- "8080:80"
30+
restart: always
31+
```
32+
33+
### FPM-Alpine
34+
35+
The FPM-Alpine image requires a separate web server. The following example uses Nginx.
36+
37+
Here is an example `docker-compose.yml` snippet:
38+
39+
```yaml
40+
services:
41+
drupal:
42+
image: hussainweb/drupal-base:php8.4-alpine
43+
volumes:
44+
- ./path/to/your/drupal/root:/var/www/html
45+
restart: always
46+
47+
nginx:
48+
image: nginx:latest
49+
ports:
50+
- "8080:80"
51+
volumes:
52+
- ./path/to/your/drupal/root:/var/www/html
53+
- ./path/to/your/nginx.conf:/etc/nginx/conf.d/default.conf
54+
depends_on:
55+
- drupal
56+
restart: always
57+
```
58+
59+
You will also need an `nginx.conf` file. Here is a basic example:
60+
61+
```conf
62+
server {
63+
listen 80;
64+
server_name your-domain.com;
65+
root /var/www/html;
66+
67+
location / {
68+
try_files $uri /index.php?$query_string;
69+
}
70+
71+
location ~ \.php$ {
72+
fastcgi_pass drupal:9000;
73+
fastcgi_index index.php;
74+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
75+
include fastcgi_params;
76+
}
77+
}
78+
```

0 commit comments

Comments
 (0)