Skip to content

Commit dcdf7a4

Browse files
authored
Merge pull request #1 from shochdoerfer/feature/gally_premium
Allow to install Gally Premium packages
2 parents b65cd2c + 169a2a4 commit dcdf7a4

File tree

5 files changed

+73
-22
lines changed

5 files changed

+73
-22
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
## 0.1.2
6+
7+
### Added
8+
9+
- Support Gally Premium installation
10+
11+
### Deprecated
12+
13+
- Nothing.
14+
15+
### Removed
16+
17+
- Nothing.
18+
19+
### Fixed
20+
21+
- Nothing.
22+
523
## 0.1.1
624

725
### Added

README.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ ddev restart
2121

2222
After installation, make sure to commit the `.ddev` directory to version control.
2323

24+
### Gally Premium Installation
25+
26+
To install Gally Premium, set the `GALLY_PREMIUM_NAME` and `GALLY_PREMIUM_TOKEN` environment variables in `.ddev/.env.gally` before running `ddev restart`.
27+
28+
If you want to use the AI features of Gally, you need to enable AI support for Opensearch by adding the following lines to the environment section in the file `.ddev/docker-compose.opensearch.yaml`:
29+
```yaml
30+
- plugins.ml_commons.only_run_on_ml_node=false
31+
- plugins.ml_commons.allow_registering_model_via_url=true
32+
- plugins.ml_commons.native_memory_threshold=100
33+
- plugins.ml_commons.jvm_heap_memory_threshold=100
34+
```
35+
2436
## Post-Installation steps
2537
2638
To initialize the Gally database, run `ddev gally-cli doctrine:migrations:migrate`.
@@ -35,26 +47,28 @@ Make sure to commit the `.ddev/.env.gally` file to version control.
3547

3648
All customization options (use with caution):
3749

38-
| Variable | Default |
39-
|--------------------------|-----------------------------------------------------------|
40-
| GALLY_VERSION | 2.2.0 |
41-
| GALLY_HOSTNAME | ${DDEV_SITENAME}-gally.ddev.site |
42-
| GALLY_CATALOG_MEDIA_URL | https://${DDEV_SITENAME}.ddev.site/media/catalog/product/ |
43-
| GALLY_API_ROUTE_PREFIX | api |
44-
| GALLY_APP_ENV | prod |
45-
| GALLY_APP_DEBUG | 0 |
46-
| GALLY_APP_SECRET | Bh9Phhoceiyasa7iebf22hah6OdfN8oh |
47-
| GALLY_DB_HOST | gally-db |
48-
| GALLY_DB_PORT | 5432 |
49-
| GALLY_DB_NAME | gally |
50-
| GALLY_DB_USER | gally |
51-
| GALLY_DB_PASSWORD | gally |
52-
| POSTGRES_VERSION | 16 |
53-
| VARNISH_VERSION | 8.0 |
54-
| REDIS_HOST | redis |
55-
| REDIS_DB | 0 |
56-
| OPENSEARCH_HOST | opensearch |
57-
| OPENSEARCH_PORT | 9200 |
50+
| Variable | Default |
51+
|-------------------------|-----------------------------------------------------------|
52+
| GALLY_VERSION | 2.2.0 |
53+
| GALLY_PREMIUM_NAME | |
54+
| GALLY_PREMIUM_TOKEN | |
55+
| GALLY_HOSTNAME | ${DDEV_SITENAME}-gally.ddev.site |
56+
| GALLY_CATALOG_MEDIA_URL | https://${DDEV_SITENAME}.ddev.site/media/catalog/product/ |
57+
| GALLY_API_ROUTE_PREFIX | api |
58+
| GALLY_APP_ENV | prod |
59+
| GALLY_APP_DEBUG | 0 |
60+
| GALLY_APP_SECRET | Bh9Phhoceiyasa7iebf22hah6OdfN8oh |
61+
| GALLY_DB_HOST | gally-db |
62+
| GALLY_DB_PORT | 5432 |
63+
| GALLY_DB_NAME | gally |
64+
| GALLY_DB_USER | gally |
65+
| GALLY_DB_PASSWORD | gally |
66+
| POSTGRES_VERSION | 16 |
67+
| VARNISH_VERSION | 8.0 |
68+
| REDIS_HOST | redis |
69+
| REDIS_DB | 0 |
70+
| OPENSEARCH_HOST | opensearch |
71+
| OPENSEARCH_PORT | 9200 |
5872

5973
## License
6074

docker-compose.gally.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ services:
66

77
gally:
88
container_name: ddev-${DDEV_SITENAME}-gally
9-
image: ddev-${DDEV_SITENAME}-gally:${GALLY_VERSION}
109
labels:
1110
com.ddev.site-name: ${DDEV_SITENAME}
1211
com.ddev.approot: ${DDEV_APPROOT}
1312
build:
1413
context: ./gally
1514
args:
1615
- GALLY_VERSION=${GALLY_VERSION}
16+
- GALLY_PREMIUM_NAME=${GALLY_PREMIUM_NAME}
17+
- GALLY_PREMIUM_TOKEN=${GALLY_PREMIUM_TOKEN}
1718
- POSTGRES_VERSION=${POSTGRES_VERSION}
1819
- NEXT_PUBLIC_ENTRYPOINT=${GALLY_HOSTNAME}
1920
- NEXT_PUBLIC_API_URL=https://${GALLY_HOSTNAME}/${GALLY_API_ROUTE_PREFIX}

gally/Dockerfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ FROM dunglas/frankenphp:1.11.0-php8.3-bookworm
44
ARG GALLY_VERSION
55
ENV GALLY_VERSION $GALLY_VERSION
66

7+
ARG GALLY_PREMIUM_NAME
8+
ENV GALLY_PREMIUM_NAME $GALLY_PREMIUM_NAME
9+
10+
ARG GALLY_PREMIUM_TOKEN
11+
ENV GALLY_PREMIUM_TOKEN $GALLY_PREMIUM_TOKEN
12+
713
ARG POSTGRES_VERSION
814
ENV POSTGRES_VERSION $POSTGRES_VERSION
915

1016
# Install global dependencies
1117
RUN apt-get update ; \
12-
apt-get install -y curl gettext gnupg lsb-release openssl runit ; \
18+
apt-get install -y curl gettext gnupg lsb-release openssl runit unzip ; \
1319
mkdir -p /var/log/frankenphp/ ; \
1420
mkdir -p /var/log/yarn/ ;
1521

@@ -35,6 +41,16 @@ RUN install-php-extensions \
3541
RUN curl -L https://github.com/Elastic-Suite/gally/archive/refs/tags/v${GALLY_VERSION}.tar.gz | tar -xz --strip-components=1 ; \
3642
cd /app/api && composer install
3743

44+
# Install Gally Premium if vars are defined
45+
RUN if [ -n "$GALLY_PREMIUM_NAME" ] && [ -n "$GALLY_PREMIUM_TOKEN" ]; then \
46+
{ \
47+
cd /app/api; \
48+
composer config http-basic.elasticsuite.repo.packagist.com token "${GALLY_PREMIUM_TOKEN}"; \
49+
composer config repositories.gally-premium composer https://elasticsuite.repo.packagist.com/${GALLY_PREMIUM_NAME}/; \
50+
composer require gally/gally-premium; \
51+
}; \
52+
fi
53+
3854
# Install Gally PWA and dependencies
3955
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash; \
4056
export NVM_DIR="/config/nvm"; \

gally/scripts/setup/env.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
$content = <<<EOT
88
#ddev-generated
99
GALLY_VERSION=2.2.0
10+
GALLY_PREMIUM_NAME=
11+
GALLY_PREMIUM_TOKEN=
1012
GALLY_HOSTNAME=$projectName-gally.ddev.site
1113
GALLY_CATALOG_MEDIA_URL=https://$projectName.ddev.site/media/catalog/product/
1214
GALLY_API_ROUTE_PREFIX=api

0 commit comments

Comments
 (0)