Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove web writable generated directory for Magento2 #320

Merged
merged 3 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/magento2/docker/image/console/Dockerfile.twig
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion src/magento2/harness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ attributes:
- '/app/pub/static'
- '/app/var'
- '/app/pub/static/frontend'
- '/app/generated'
- "= (@('app.mode') !== 'production' ? '/app/generated' : '')"
services:
- chrome
- cron
Expand Down
1 change: 1 addition & 0 deletions src/magento2/harness/attributes/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ attributes:
php-base:
environment:
MAGENTO_CRYPT_KEY: = @('magento.crypt.key')
MAGE_MODE: "= (@('app.mode') == 'production') ? 'production' : 'developer')"
jbarton123 marked this conversation as resolved.
Show resolved Hide resolved
pipeline:
preview:
persistence:
Expand Down