diff --git a/src/magento2/docker/image/console/Dockerfile.twig b/src/magento2/docker/image/console/Dockerfile.twig new file mode 100644 index 000000000..1c447bc4f --- /dev/null +++ b/src/magento2/docker/image/console/Dockerfile.twig @@ -0,0 +1,36 @@ +FROM {{ @('docker.image.console') }} + +COPY .my127ws/docker/image/console/root / +RUN chown -R build:build /home/build \ + && curl -L -o /usr/local/bin/mhsendmail -sS -f https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ + && chmod +x /usr/local/bin/mhsendmail + +ENV APP_MODE={{ @('app.mode') }} \ + APP_BUILD={{ @('app.build') }} \ + ASSETS_DIR={{ @('assets.local') }} \ + MAGE_MODE={{ (@('app.mode') == 'production') ? 'production' : 'developer' }} + +{% if @('node.version') is not null %} +USER build +RUN . /home/build/.nvm/nvm.sh \ + && nvm install {{ @('node.version') }} \ + && nvm use {{ @('node.version') }} \ + && nvm alias default {{ @('node.version') }} \ + && npm install -g yarn +USER root +{% endif %} + +{% if @('app.build') == 'static' %} +RUN chown build:build /app +COPY --chown=build:build .my127ws/application /home/build/application +COPY --chown=build:build ./ /app +USER build +RUN app build +USER root +{% else %} +VOLUME /app +VOLUME /home/build/application +{% endif %} + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["sleep", "infinity"] diff --git a/src/magento2/harness.yml b/src/magento2/harness.yml index 94c245a89..7d384db16 100644 --- a/src/magento2/harness.yml +++ b/src/magento2/harness.yml @@ -23,7 +23,7 @@ attributes: - '/app/pub/static' - '/app/var' - '/app/pub/static/frontend' - - '/app/generated' + - "= (@('app.mode') !== 'production' ? '/app/generated' : '')" services: - chrome - cron diff --git a/src/magento2/harness/attributes/docker.yml b/src/magento2/harness/attributes/docker.yml index 3ebbc62b2..176457e28 100644 --- a/src/magento2/harness/attributes/docker.yml +++ b/src/magento2/harness/attributes/docker.yml @@ -3,6 +3,7 @@ attributes: php-base: environment: MAGENTO_CRYPT_KEY: = @('magento.crypt.key') + MAGE_MODE: "= (@('app.mode') == 'production' ? 'production' : 'developer')" pipeline: preview: persistence: