-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fa1ffa
commit d22bd14
Showing
10 changed files
with
261 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ $0 [--archive] | |
EOF | ||
} | ||
|
||
HARNESSES=(nextjs) | ||
HARNESSES=(nextjs alokai) | ||
ARCHIVE=0 | ||
ARGS=() | ||
|
||
|
22 changes: 22 additions & 0 deletions
22
src/alokai/_twig/docker-compose.yml/service/middleware.yml.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
services: | ||
middleware: | ||
{% if @('app.build' == 'static') %} | ||
build: | ||
context: ./ | ||
dockerfile: .vuestorefrontcloud/docker/middleware/Dockerfile-middleware | ||
args: {{ to_nice_yaml(@('services.middleware.build.args'), 2, 8) }} | ||
{% else %} | ||
extends: console | ||
working_dir: /app/apps/storefront-middleware | ||
command: [ {{ @('node.packageManager') | json_encode }}, run, dev ] | ||
{% endif %} | ||
labels: | ||
# Traefik 1, deprecated | ||
- traefik.enable=false | ||
environment: {{ to_nice_yaml(deep_merge([ | ||
@('services.middleware.environment'), | ||
@('services.middleware.environment_dynamic'), | ||
@('services.middleware.environment_secrets') | ||
]), 2, 6) }} | ||
networks: | ||
- private |
26 changes: 26 additions & 0 deletions
26
src/alokai/_twig/docker-compose.yml/service/nextjs.yml.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
services: | ||
nextjs: | ||
{% if @('app.build' == 'static') %} | ||
build: | ||
context: ./ | ||
dockerfile: .vuestorefrontcloud/docker/nextjs/Dockerfile-frontend | ||
args: {{ to_nice_yaml(deep_merge([ | ||
@('services.nextjs.build.args'), | ||
@('services.nextjs.environment') | ||
]), 2, 8) }} | ||
{% else %} | ||
extends: console | ||
working_dir: /app/apps/storefront-unified-nextjs | ||
command: [ {{ @('node.packageManager') | json_encode }}, run, dev ] | ||
{% endif %} | ||
labels: | ||
# Traefik 1, deprecated | ||
- traefik.enable=false | ||
environment: {{ to_nice_yaml(deep_merge([ | ||
@('app.build') == 'dynamic' ? @('services.nextjs.build.args') : [], | ||
@('services.nextjs.environment'), | ||
@('services.nextjs.environment_dynamic'), | ||
@('services.nextjs.environment_secrets') | ||
]), 2, 6) }} | ||
networks: | ||
- private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% if @('app.build') == 'host' %} | ||
{% for name, value in @('services.middleware.environment')|merge(@('services.middleware.environment_secrets')) %} | ||
{{ name }}={{ value }} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% if @('app.build') == 'host' %} | ||
{% for name, value in @('services.nextjs.build.args') | filter((value, key) => key starts with 'NEXT_PUBLIC_') %} | ||
{{ name }}={{ value }} | ||
{% endfor %} | ||
{% for name, value in @('services.nextjs.environment')|merge(@('services.nextjs.environment_secrets')) %} | ||
{{ name }}={{ value }} | ||
{% endfor %} | ||
{% endif %} |
47 changes: 47 additions & 0 deletions
47
src/alokai/docker/image/nginx/root/etc/nginx/conf.d/default.conf.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
map $http_upgrade $connection_upgrade { | ||
default upgrade; | ||
'' close; | ||
} | ||
|
||
server { | ||
|
||
listen 80 default_server; | ||
listen 443 ssl default_server; | ||
http2 on; | ||
|
||
server_name _; | ||
|
||
ssl_certificate /etc/ssl/certs/app.crt; | ||
ssl_certificate_key /etc/ssl/private/app.key; | ||
|
||
set $custom_https $https; | ||
set $custom_scheme $scheme; | ||
|
||
if ($http_x_forwarded_proto) { | ||
set $custom_scheme $http_x_forwarded_proto; | ||
} | ||
|
||
location / { | ||
proxy_pass http://nextjs:3000; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $custom_scheme; | ||
proxy_buffers 4 256k; | ||
proxy_buffer_size 128k; | ||
proxy_busy_buffers_size 256k; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
} | ||
|
||
location /api/ { | ||
proxy_pass http://middleware:4000/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $custom_scheme; | ||
proxy_buffers 4 256k; | ||
proxy_buffer_size 128k; | ||
proxy_busy_buffers_size 256k; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
harness('inviqa/alokai'): | ||
description: A docker based development environment for Alokai | ||
harnessLayers: | ||
- inviqa/docker:v0.4.0 | ||
require: | ||
services: | ||
- proxy | ||
confd: | ||
- harness:/ | ||
--- | ||
attributes: | ||
alokai: | ||
multistore: | ||
enabled: false | ||
|
||
node: | ||
packageManager: yarn | ||
version: '18' | ||
|
||
npm: | ||
login: true | ||
registry: | ||
# username: | ||
# password: | ||
# email: # email address ignored but field required | ||
url: https://registrynpm.storefrontcloud.io | ||
scope: '@vsf-enterprise' | ||
|
||
services: | ||
console: | ||
build: | ||
from: = 'node:' ~ @('node.version') ~ '-slim' | ||
args: | ||
NPM_USER: = @('npm.registry.username') | ||
NPM_PASS: = @('npm.registry.password') | ||
NPM_EMAIL: = @('npm.registry.email') | ||
NPM_REGISTRY: = @('npm.registry.url') | ||
NPM_SCOPE: = @('npm.registry.scope') | ||
publish: false | ||
nginx: | ||
enabled: true | ||
relay: | ||
enabled: false | ||
middleware: | ||
enabled: true | ||
build: | ||
args: | ||
NPM_USER: = @('npm.registry.username') | ||
NPM_PASS: = @('npm.registry.password') | ||
NPM_EMAIL: = @('npm.registry.email') | ||
NPM_REGISTRY: = @('npm.registry.url') | ||
NPM_SCOPE: = @('npm.registry.scope') | ||
environment: | ||
### Commerce | ||
IS_MULTISTORE_ENABLED: > | ||
= @('app.build') == 'host' ? 'false' | ||
: @('alokia.multistore.enabled') ? 'true' | ||
: false | ||
# BIGCOMMERCE_API_CLIENT_ID: | ||
# BIGCOMMERCE_API_URL: | ||
# BIGCOMMERCE_STORE_ID: | ||
|
||
### CMS | ||
# Contentful config | ||
# CNTF_SPACE: | ||
# CNTF_ENVIRONMENT: | ||
environment_secrets: | ||
# BIGCOMMERCE_API_CLIENT_SECRET: | ||
# BIGCOMMERCE_API_ACCESS_TOKEN: | ||
# BIGCOMMERCE_STORE_GUEST_TOKEN: | ||
# CNTF_TOKEN: | ||
nextjs: | ||
enabled: true | ||
build: | ||
args: | ||
NPM_USER: = @('npm.registry.username') | ||
NPM_PASS: = @('npm.registry.password') | ||
NPM_EMAIL: = @('npm.registry.email') | ||
NPM_REGISTRY: = @('npm.registry.url') | ||
NPM_SCOPE: = @('npm.registry.scope') | ||
|
||
NEXT_PUBLIC_API_BASE_URL: > | ||
= @('app.build') == 'host' ? 'http://localhost:4000' | ||
: @('alokia.multistore.enabled') ? '/api' | ||
: 'https://' ~ @('hostname') ~ '/api' | ||
NEXT_PUBLIC_IS_MULTISTORE_ENABLED: > | ||
= @('app.build') == 'host' ? 'false' | ||
: @('alokia.multistore.enabled') ? 'true' | ||
: false | ||
# Default Image Loader fetch url. | ||
# For Cloudinary check https://cloudinary.com/documentation/fetch_remote_images#fetch_and_deliver_remote_files | ||
# NEXT_PUBLIC_IMAGE_LOADER_FETCH_URL: https://res.cloudinary.com/dcqchkrzw/image/fetch/ | ||
|
||
# Optional. Will be used when image url will not start with http. | ||
# For Cloudinary check https://cloudinary.com/documentation/migration#lazy_migration_with_auto_upload | ||
# NEXT_PUBLIC_IMAGE_LOADER_UPLOAD_URL: https://res.cloudinary.com/vsf-sap/image/upload/ | ||
environment: {} # no NEXT_PUBLIC variables supported for runtime | ||
environment_secrets: | ||
# to allow nextjs server-side talking to nginx https locally for middleware routing | ||
NODE_TLS_REJECT_UNAUTHORIZED: '0' | ||
--- | ||
import: | ||
- harness/config/*.yml | ||
- harness/attributes/*.yml | ||
- harness/attributes/environment/={env('MY127WS_ENV','local')}.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# this file is not considered part of the public API so changes aren't considered breaking | ||
confd('harness:/'): | ||
# inviqa/docker templates | ||
- { src: docker/image/console/Dockerfile } | ||
- { src: docker/image/console/home/.my.cnf } | ||
- { src: docker/image/console/root/entrypoint.sh } | ||
- { src: docker/image/console/root/usr/lib/task/build.sh } | ||
- { src: docker/image/console/root/usr/lib/task/database/import.sh } | ||
- { src: docker/image/console/root/usr/lib/task/init.sh } | ||
- { src: docker/image/console/root/usr/lib/task/install.sh } | ||
- { src: docker/image/console/root/usr/lib/task/migrate.sh } | ||
- { src: docker/image/console/root/usr/lib/task/rabbitmq/vhosts.sh } | ||
- { src: docker/image/console/root/usr/lib/task/welcome.sh } | ||
- { src: docker/image/lighthouse/Dockerfile } | ||
- { src: docker/image/lighthouse/root/app/run.sh } | ||
- { src: docker/image/solr/Dockerfile } | ||
- { src: docker/image/tls-offload/root/etc/nginx/conf.d/0-nginx.conf } | ||
- { src: docker/image/tls-offload/root/etc/nginx/conf.d/default.conf } | ||
- { src: docker/image/tls-offload/root/etc/ssl/certs/app.crt } | ||
- { src: docker/image/tls-offload/root/etc/ssl/private/app.key } | ||
- { src: docker/image/varnish/root/etc/varnish/default.vcl } | ||
- { src: application/overlay/Jenkinsfile } | ||
- { src: application/overlay/.dockerignore, dst: workspace:/.dockerignore } | ||
- { src: application/skeleton/README.md } | ||
- { src: mutagen.yml, dst: workspace:/mutagen.yml } # docker-compose.yml render reads this file | ||
- { src: docker-compose.yml, dst: workspace:/docker-compose.yml } | ||
- { src: harness/scripts/enable.sh } | ||
- { src: helm/app/_twig/templates/service/varnish/configmap.yaml, dst: harness:/helm/app/templates/service/varnish/configmap.yaml } | ||
- { src: helm/app/values.yaml } | ||
- { src: helm/app/values-production.yaml } | ||
- { src: helm/app/values-preview.yaml } | ||
- { src: helm/app/Chart.yaml } | ||
# node/_base templates | ||
- { src: docker/image/nginx/root/etc/nginx/conf.d/default.conf } | ||
- { src: docker/image/nginx/root/etc/ssl/certs/app.crt } | ||
- { src: docker/image/nginx/root/etc/ssl/private/app.key } | ||
# node/alokai templates | ||
- { src: _twig/middleware.env, dst: workspace:/apps/storefront-middleware/.env } | ||
- { src: _twig/nextjs.env, dst: workspace:/apps/storefront-unified-nextjs/.env } |