Skip to content

Commit

Permalink
[SC-8619] Frontend cannot be started when debug mode is enabled (#278)
Browse files Browse the repository at this point in the history
* Nginx. Debug configuration

* Adjust Nging configuration
  • Loading branch information
alexanderM91 authored Feb 3, 2022
1 parent 7b8de7b commit 1777dff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions bin/sdk/images/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ function Images::_buildFrontend() {
-f "${DEPLOYMENT_PATH}/images/debug/frontend/Dockerfile" \
--progress="${PROGRESS_TYPE}" \
--build-arg "SPRYKER_PARENT_IMAGE=${frontendImage}" \
--build-arg "SPRYKER_XDEBUG_MODE_ENABLE=${SPRYKER_XDEBUG_MODE_ENABLE}" \
"${DEPLOYMENT_PATH}/context" 1>&2
fi
}
Expand Down
4 changes: 4 additions & 0 deletions generator/src/templates/nginx/entrypoint.sh.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ fi

envsubst '$SPRYKER_DNS_RESOLVER_IP ${SPRYKER_DNS_RESOLVER_FLAGS} {{ envVariables | join(' ') }}' < /etc/nginx/template/resolver.conf.tmpl > /etc/nginx/conf.d/00-resolver.conf

if [ -n "${SPRYKER_XDEBUG_MODE_ENABLE}" ]; then
envsubst '$SPRYKER_BUILD_HASH' < /etc/nginx/template/debug.default.conf > /etc/nginx/conf.d/debug.default.conf
fi

exec "$@"
1 change: 1 addition & 0 deletions images/common/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ RUN mkdir -p /usr/share/nginx/ \
&& rm -f /tmp/build.json

ENTRYPOINT [ "/entrypoint.sh" ]

CMD ["nginx", "-g", "daemon off;"]
5 changes: 4 additions & 1 deletion images/debug/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
ARG SPRYKER_PARENT_IMAGE
FROM ${SPRYKER_PARENT_IMAGE} AS frontend-debug

COPY --chown=root:root nginx/conf.d/debug.default.conf /etc/nginx/conf.d/debug.default.conf
ARG SPRYKER_XDEBUG_MODE_ENABLE
ENV SPRYKER_XDEBUG_MODE_ENABLE=${SPRYKER_XDEBUG_MODE_ENABLE}

COPY --chown=root:root nginx/conf.d/debug.default.conf /etc/nginx/template/debug.default.conf

0 comments on commit 1777dff

Please sign in to comment.