Skip to content

Commit 8fb7729

Browse files
committed
Allow static site builds using tome
1 parent ae8de53 commit 8fb7729

File tree

5 files changed

+32
-16
lines changed

5 files changed

+32
-16
lines changed

.dockerignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.git*
2-
db
2+
Dockerfile
33
README.md
44
compose.yaml
5+
db
6+
html

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
html

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM docker.io/library/drupal:10-apache
2+
RUN composer require 'drupal/paragraphs:^1.19' \
3+
&& composer require 'drupal/tome:^1.13' \
4+
&& composer config --no-plugins allow-plugins.composer/installers true \
5+
&& composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true \
6+
&& composer config --no-plugins allow-plugins.drupal/core-project-message true \
7+
&& composer require drush/drush \
8+
&& mkdir -m 777 /var/www/html/sites/default/files \
9+
&& cp /var/www/html/sites/default/default.settings.php /var/www/html/sites/default/settings.php \
10+
&& echo "\$databases['default']['default'] = ['driver' => 'sqlite', 'database' => '/mnt/drupal.sqlite'];" >> /var/www/html/sites/default/settings.php
11+
COPY --chmod=555 . /var/www/html/modules/finder
12+
ENV PATH="/opt/drupal/vendor/bin:${PATH}"
13+
ENTRYPOINT ["/var/www/html/modules/finder/entrypoint.sh"]

compose.yaml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
services:
22
drupal:
3-
build:
4-
dockerfile_inline: |
5-
FROM docker.io/library/drupal:10-apache
6-
RUN composer require 'drupal/paragraphs:^1.19' \
7-
&& composer config --no-plugins allow-plugins.composer/installers true \
8-
&& composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true \
9-
&& composer config --no-plugins allow-plugins.drupal/core-project-message true \
10-
&& composer require drush/drush \
11-
&& mkdir -m 777 /var/www/html/sites/default/files \
12-
&& cp /var/www/html/sites/default/default.settings.php /var/www/html/sites/default/settings.php \
13-
&& echo "\$$databases['default']['default'] = ['driver' => 'sqlite', 'database' => '/mnt/drupal.sqlite'];" >> /var/www/html/sites/default/settings.php
14-
COPY --chmod=555 . /var/www/html/modules/finder
15-
ENV PATH="/opt/drupal/vendor/bin:${PATH}"
16-
ENTRYPOINT ["/var/www/html/modules/finder/entrypoint.sh"]
3+
build: .
174
healthcheck:
185
test: ["CMD", "curl", "-f", "http://localhost"]
196
ports:
207
- "80:80"
218
volumes:
22-
- ./db:/mnt
9+
- ./db:/mnt
10+
- ./html:/opt/drupal/html
11+
profiles:
12+
- drupal
13+
14+
static:
15+
build: .
16+
entrypoint: ["drush", "tome:static"]
17+
volumes:
18+
- ./db:/mnt
19+
- ./html:/opt/drupal/html
20+
profiles:
21+
- static

entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ then
88
drush cache:rebuild
99
drush pm:enable paragraphs -y
1010
drush pm:enable finder -y
11+
drush pm:enable tome_static -y
1112
drush cache:rebuild
1213
chmod 777 /mnt/drupal.sqlite
1314
fi

0 commit comments

Comments
 (0)