diff --git a/.env.example b/.env.example index d3d22d45..eb8e47b4 100644 --- a/.env.example +++ b/.env.example @@ -379,6 +379,7 @@ APACHE_PHP_UPSTREAM_TIMEOUT=60 APACHE_DOCUMENT_ROOT=/var/www/ APACHE_SSL_PATH=./apache2/ssl/ APACHE_INSTALL_HTTP2=false +APACHE_FOR_MAC_M1=false ### MYSQL ################################################# diff --git a/DOCUMENTATION/content/help/index.md b/DOCUMENTATION/content/help/index.md index c10bb00a..8f3e6557 100644 --- a/DOCUMENTATION/content/help/index.md +++ b/DOCUMENTATION/content/help/index.md @@ -127,3 +127,21 @@ WORKSPACE_INSTALL_LIBPNG=true docker-compose build workspace ``` +## Apache2 container won't start on mac m1 + +To fix the problem you can follow those steps + +1 - Open the `.env`. + +2 - Search for `APACHE_FOR_MAC_M1` or add the key, if missing. + +3 - Set the value to true: + +```dotenv +APACHE_FOR_MAC_M1=true +``` +4 - Finally rebuild the workspace image + +```bash +docker-compose build apache2 +``` diff --git a/apache2/Dockerfile b/apache2/Dockerfile index 9fd43154..a24cc9c4 100644 --- a/apache2/Dockerfile +++ b/apache2/Dockerfile @@ -29,4 +29,13 @@ ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"] CMD ["/bin/bash", "/opt/startup.sh"] -EXPOSE 80 443 \ No newline at end of file +EXPOSE 80 443 + +ARG APACHE_FOR_MAC_M1=false + +RUN if [ ${APACHE_FOR_MAC_M1} = true ]; then \ + # Change application source from deb.debian.org to aliyun source + wget -O "/usr/local/bin/go-replace" "https://github.com/webdevops/goreplace/releases/download/1.1.2/gr-arm64-linux" && \ + chmod +x "/usr/local/bin/go-replace" && \ + "/usr/local/bin/go-replace" --version \ +;fi diff --git a/docker-compose.yml b/docker-compose.yml index 01704319..7007d00c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -485,6 +485,7 @@ services: - PHP_UPSTREAM_TIMEOUT=${APACHE_PHP_UPSTREAM_TIMEOUT} - DOCUMENT_ROOT=${APACHE_DOCUMENT_ROOT} - APACHE_INSTALL_HTTP2=${APACHE_INSTALL_HTTP2} + - APACHE_FOR_MAC_M1=${APACHE_FOR_MAC_M1} volumes: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} - ${APACHE_HOST_LOG_PATH}:/var/log/apache2