Skip to content

Commit 0044679

Browse files
committed
NodeJS = enable/disable
1 parent cf9c31e commit 0044679

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

.env.dist

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ CLEAN_NGINX_LOGS=no
146146
CLEAN_SF_logs=no
147147

148148
# docker-compose.yml configuration
149+
NODEJS=no
149150
YARN=no
150151
WKHTMLTOPDF=no
151152
MAILHOG=no

commands/start.go

+6
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,12 @@ func doPhpBuild() {
344344
util.Sed("__YARN__", "", "config/php/Dockerfile")
345345
}
346346

347+
if os.Getenv("NODEJS") == "yes" {
348+
util.Sed("__NODEJS__", "&& mkdir -p /var/www/.npm && mkdir -p /var/www/html && printf '{\"name\": \"d4d\", \"version\": \"1.0.0\"}' > /var/www/html/package.json && chown -R $${USER_ID}:$${GROUP_ID} /var/www/.npm && chown -R $${USER_ID}:$${GROUP_ID} /var/www/html && printf 'Package: *\\nPin: origin deb.nodesource.com\\nPin-Priority: 600' > /etc/apt/preferences.d/nodejs && curl -sL https://deb.nodesource.com/setup_$${NODE_JS_VERSION} | bash && apt-get install -y nodejs && npm install --location=global __NPM_INSTALL_GLOBAL__ \\\n ", "config/php/Dockerfile")
349+
} else {
350+
util.Sed("__NODEJS__", "", "config/php/Dockerfile")
351+
}
352+
347353
if os.Getenv("WKHTMLTOPDF") == "yes" {
348354
if os.Getenv("WKHTMLTOPDF_VERSION") == "0.12.3" {
349355
util.Sed("__WKHTMLTOPDF__", "&& curl -o wkhtmltox-${WKHTMLTOPDF_VERSION}_linux-generic-amd64.tar.xz -sL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox-${WKHTMLTOPDF_VERSION}_linux-generic-amd64.tar.xz && echo '9066ab2c7b2035c6eaa043d31aeb7260191e6c88 wkhtmltox-${WKHTMLTOPDF_VERSION}_linux-generic-amd64.tar.xz' | sha1sum -c - && tar -xvf wkhtmltox-${WKHTMLTOPDF_VERSION}_linux-generic-amd64.tar.xz && cp wkhtmltox/lib/* /usr/lib/ && cp wkhtmltox/bin/* /usr/bin/ && cp -r wkhtmltox/share/man/man1 /usr/share/man/ && chmod a+x /usr/bin/wkhtmltopdf && chmod a+x /usr/bin/wkhtmltoimage", "config/php/Dockerfile")

config/php/Dockerfile.build

+1-9
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,7 @@ RUN docker-php-ext-configure zip --with-libzip && docker-php-ext-configure gd --
5656
&& chown -R ${USER_ID}:${GROUP_ID} /var/www/.composer \
5757
&& chown ${USER_ID}:${GROUP_ID} /var/www \
5858
# npm & node
59-
&& mkdir -p /var/www/.npm \
60-
&& mkdir -p /var/www/html \
61-
&& printf '{"name": "d4d", "version": "1.0.0"}' > /var/www/html/package.json \
62-
&& chown -R ${USER_ID}:${GROUP_ID} /var/www/.npm \
63-
&& chown -R ${USER_ID}:${GROUP_ID} /var/www/html \
64-
&& printf 'Package: *\nPin: origin deb.nodesource.com\nPin-Priority: 600' > /etc/apt/preferences.d/nodejs \
65-
&& curl -sL https://deb.nodesource.com/setup_${NODE_JS_VERSION} | bash \
66-
&& apt-get install -y nodejs \
67-
&& npm install --location=global __NPM_INSTALL_GLOBAL__ \
59+
__NODEJS__ \
6860
# Yarn package manager
6961
# bugfix: remove cmdtest to install yarn correctly.
7062
__YARN__ \

0 commit comments

Comments
 (0)