diff --git a/10.1/Dockerfile b/10.1/Dockerfile index 2da4833..a147736 100644 --- a/10.1/Dockerfile +++ b/10.1/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:10.1-20190730.1 +FROM mcr.microsoft.com/oryx/node:10.1-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/10.1/startup/init_container.sh b/10.1/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/10.1/startup/init_container.sh +++ b/10.1/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/10.10/Dockerfile b/10.10/Dockerfile index c150979..eaeb0a8 100644 --- a/10.10/Dockerfile +++ b/10.10/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:10.10-20190730.1 +FROM mcr.microsoft.com/oryx/node:10.10-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/10.10/startup/init_container.sh b/10.10/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/10.10/startup/init_container.sh +++ b/10.10/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/10.12/Dockerfile b/10.12/Dockerfile index d8c325d..54f0099 100644 --- a/10.12/Dockerfile +++ b/10.12/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:10.12-20190730.1 +FROM mcr.microsoft.com/oryx/node:10.12-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/10.12/startup/init_container.sh b/10.12/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/10.12/startup/init_container.sh +++ b/10.12/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/10.14/Dockerfile b/10.14/Dockerfile index 7c0bc9c..47d6ee8 100644 --- a/10.14/Dockerfile +++ b/10.14/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:10.14-20190730.1 +FROM mcr.microsoft.com/oryx/node:10.14-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/10.14/startup/init_container.sh b/10.14/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/10.14/startup/init_container.sh +++ b/10.14/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/10.16/Dockerfile b/10.16/Dockerfile new file mode 100644 index 0000000..a65913f --- /dev/null +++ b/10.16/Dockerfile @@ -0,0 +1,53 @@ +FROM mcr.microsoft.com/oryx/node:10.16-20191018.1 +LABEL maintainer="Azure App Services Container Images " + +RUN echo "ipv6" >> /etc/modules + +RUN npm install -g pm2 \ + && mkdir -p /home/LogFiles /opt/startup \ + && echo "root:Docker!" | chpasswd \ + && echo "cd /home" >> /etc/bash.bashrc \ + && apt-get update \ + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 +# setup default site +RUN rm -f /etc/ssh/sshd_config +COPY startup /opt/startup +COPY hostingstart.html /opt/startup + +# configure startup +RUN mkdir -p /tmp +COPY sshd_config /etc/ssh/ + +COPY ssh_setup.sh /tmp +RUN chmod -R +x /opt/startup \ + && chmod -R +x /tmp/ssh_setup.sh \ + && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ + && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ + && cd /opt/startup \ + && npm install + +ENV PORT 8080 +ENV SSH_PORT 2222 +EXPOSE 2222 8080 + +ENV PM2HOME /pm2home + +ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance +ENV WEBSITE_INSTANCE_ID localInstance +ENV PATH ${PATH}:/home/site/wwwroot + +WORKDIR /home/site/wwwroot + +ENTRYPOINT ["/opt/startup/init_container.sh"] diff --git a/10.16/hostingstart.html b/10.16/hostingstart.html new file mode 100644 index 0000000..fc225bd --- /dev/null +++ b/10.16/hostingstart.html @@ -0,0 +1 @@ +Microsoft Azure App Service - Welcome

Hey, Node developers!


Your app service is up and running.

Time to take the next step and deploy your code.

Have your code ready?
Use deployment center to get code published from your client or setup continuous deployment.

Don't have your code yet?
Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.

\ No newline at end of file diff --git a/10.16/ssh_setup.sh b/10.16/ssh_setup.sh new file mode 100644 index 0000000..8bc40cc --- /dev/null +++ b/10.16/ssh_setup.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ ! -f "/etc/ssh/ssh_host_rsa_key" ]; then + # generate fresh rsa key + ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa +fi + +if [ ! -f "/etc/ssh/ssh_host_dsa_key" ]; then + # generate fresh dsa key + ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa +fi + +if [ ! -f "/etc/ssh/ssh_host_ecdsa_key" ]; then + # generate fresh ecdsa key + ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t dsa +fi + +if [ ! -f "/etc/ssh/ssh_host_ed25519_key" ]; then + # generate fresh ecdsa key + ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -t dsa +fi + +#prepare run dir +if [ ! -d "/var/run/sshd" ]; then + mkdir -p /var/run/sshd +fi diff --git a/10.16/sshd_config b/10.16/sshd_config new file mode 100644 index 0000000..04b53f9 --- /dev/null +++ b/10.16/sshd_config @@ -0,0 +1,16 @@ +# This is ssh server systemwide configuration file. +# +# /etc/sshd_config + +Port SSH_PORT +ListenAddress 0.0.0.0 +LoginGraceTime 180 +X11Forwarding yes +Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr +MACs hmac-sha1,hmac-sha1-96 +StrictModes yes +SyslogFacility DAEMON +PasswordAuthentication yes +PermitEmptyPasswords no +PermitRootLogin yes +Subsystem sftp internal-sftp diff --git a/10.16/startup/default-static-site.js b/10.16/startup/default-static-site.js new file mode 100644 index 0000000..123f525 --- /dev/null +++ b/10.16/startup/default-static-site.js @@ -0,0 +1,7 @@ +var express = require('express'); +var server = express(); +var options = { + index: ['index.html','hostingstart.html'] +}; +server.use('/', express.static('/opt/startup', options)); +server.listen(process.env.PORT); diff --git a/10.16/startup/init_container.sh b/10.16/startup/init_container.sh new file mode 100644 index 0000000..bb82fd5 --- /dev/null +++ b/10.16/startup/init_container.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +cat >/etc/motd < + \/ \/ \/ +A P P S E R V I C E O N L I N U X + +Documentation: http://aka.ms/webapp-linux +NodeJS quickstart: https://aka.ms/node-qs +NodeJS Version : `node --version` + +EOL +cat /etc/motd + +mkdir "$PM2HOME" +chmod 777 "$PM2HOME" +ln -s /home/LogFiles "$PM2HOME"/logs + +# Get environment variables to show up in SSH session +eval $(printenv | sed -n "s/^\([^=]\+\)=\(.*\)$/export \1=\2/p" | sed 's/"/\\\"/g' | sed '/=/s//="/' | sed 's/$/"/' >> /etc/profile) + +# starting sshd process +sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config +/usr/sbin/sshd + +STARTUP_COMMAND_PATH="/opt/startup/startup.sh" +ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" + +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then + ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then + ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" +fi + +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then + # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in + # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. + echo 'Fixing up path' + export PATH=/node_modules/.bin:$PATH + echo "$PATH" +fi + +eval oryx $ORYX_ARGS + +STARTUPCOMMAND=$(cat $STARTUP_COMMAND_PATH) +echo "Running $STARTUPCOMMAND" +$STARTUP_COMMAND_PATH diff --git a/10.16/startup/npm-shrinkwrap.json b/10.16/startup/npm-shrinkwrap.json new file mode 100644 index 0000000..5eef997 --- /dev/null +++ b/10.16/startup/npm-shrinkwrap.json @@ -0,0 +1,216 @@ +{ + "name": "default-static-site", + "version": "1.0.0", + "dependencies": { + "accepts": { + "version": "1.3.3", + "from": "accepts@>=1.3.3 <1.4.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz" + }, + "array-flatten": { + "version": "1.1.1", + "from": "array-flatten@1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz" + }, + "content-disposition": { + "version": "0.5.2", + "from": "content-disposition@0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz" + }, + "content-type": { + "version": "1.0.2", + "from": "content-type@>=1.0.2 <1.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz" + }, + "cookie": { + "version": "0.3.1", + "from": "cookie@0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz" + }, + "cookie-signature": { + "version": "1.0.6", + "from": "cookie-signature@1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" + }, + "debug": { + "version": "2.6.7", + "from": "debug@2.6.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz" + }, + "depd": { + "version": "1.1.0", + "from": "depd@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz" + }, + "destroy": { + "version": "1.0.4", + "from": "destroy@>=1.0.4 <1.1.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz" + }, + "ee-first": { + "version": "1.1.1", + "from": "ee-first@1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" + }, + "encodeurl": { + "version": "1.0.1", + "from": "encodeurl@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz" + }, + "escape-html": { + "version": "1.0.3", + "from": "escape-html@>=1.0.3 <1.1.0", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz" + }, + "etag": { + "version": "1.8.0", + "from": "etag@>=1.8.0 <1.9.0", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz" + }, + "express": { + "version": "4.15.3", + "from": "express@4.15.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.15.3.tgz" + }, + "finalhandler": { + "version": "1.0.3", + "from": "finalhandler@>=1.0.3 <1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.3.tgz" + }, + "forwarded": { + "version": "0.1.0", + "from": "forwarded@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.0.tgz" + }, + "fresh": { + "version": "0.5.0", + "from": "fresh@0.5.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz" + }, + "http-errors": { + "version": "1.6.1", + "from": "http-errors@>=1.6.1 <1.7.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz" + }, + "inherits": { + "version": "2.0.3", + "from": "inherits@2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + }, + "ipaddr.js": { + "version": "1.3.0", + "from": "ipaddr.js@1.3.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.3.0.tgz" + }, + "media-typer": { + "version": "0.3.0", + "from": "media-typer@0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" + }, + "merge-descriptors": { + "version": "1.0.1", + "from": "merge-descriptors@1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz" + }, + "methods": { + "version": "1.1.2", + "from": "methods@>=1.1.2 <1.2.0", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz" + }, + "mime": { + "version": "1.3.4", + "from": "mime@1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz" + }, + "mime-db": { + "version": "1.27.0", + "from": "mime-db@>=1.27.0 <1.28.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz" + }, + "mime-types": { + "version": "2.1.15", + "from": "mime-types@>=2.1.11 <2.2.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz" + }, + "ms": { + "version": "2.0.0", + "from": "ms@2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + }, + "negotiator": { + "version": "0.6.1", + "from": "negotiator@0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz" + }, + "on-finished": { + "version": "2.3.0", + "from": "on-finished@>=2.3.0 <2.4.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz" + }, + "parseurl": { + "version": "1.3.1", + "from": "parseurl@>=1.3.1 <1.4.0", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz" + }, + "path-to-regexp": { + "version": "0.1.7", + "from": "path-to-regexp@0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz" + }, + "proxy-addr": { + "version": "1.1.4", + "from": "proxy-addr@>=1.1.4 <1.2.0", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.4.tgz" + }, + "qs": { + "version": "6.4.0", + "from": "qs@6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz" + }, + "range-parser": { + "version": "1.2.0", + "from": "range-parser@>=1.2.0 <1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz" + }, + "send": { + "version": "0.15.3", + "from": "send@0.15.3", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.3.tgz" + }, + "serve-static": { + "version": "1.12.3", + "from": "serve-static@1.12.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz" + }, + "setprototypeof": { + "version": "1.0.3", + "from": "setprototypeof@1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz" + }, + "statuses": { + "version": "1.3.1", + "from": "statuses@>=1.3.1 <1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz" + }, + "type-is": { + "version": "1.6.15", + "from": "type-is@>=1.6.15 <1.7.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz" + }, + "unpipe": { + "version": "1.0.0", + "from": "unpipe@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" + }, + "utils-merge": { + "version": "1.0.0", + "from": "utils-merge@1.0.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz" + }, + "vary": { + "version": "1.1.1", + "from": "vary@>=1.1.1 <1.2.0", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz" + } + } +} diff --git a/10.16/startup/package.json b/10.16/startup/package.json new file mode 100644 index 0000000..9cf0726 --- /dev/null +++ b/10.16/startup/package.json @@ -0,0 +1,15 @@ +{ + "name": "default-static-site", + "version": "1.0.0", + "description": "Express-driven static site hosted from default App Service wwwroot directory", + "main": "default-static-site.js", + "dependencies": { + "express": "4.15.3" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Azure App Services Container Images ", + "license": "Apache-2.0" +} diff --git a/10/Dockerfile b/10/Dockerfile index 5e53052..dd227e3 100644 --- a/10/Dockerfile +++ b/10/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:10-20190730.1 +FROM mcr.microsoft.com/oryx/node:10-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/10/startup/init_container.sh b/10/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/10/startup/init_container.sh +++ b/10/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/12.9/Dockerfile b/12.9/Dockerfile new file mode 100644 index 0000000..63d3dc9 --- /dev/null +++ b/12.9/Dockerfile @@ -0,0 +1,53 @@ +FROM mcr.microsoft.com/oryx/node:12.9-20191018.1 +LABEL maintainer="Azure App Services Container Images " + +RUN echo "ipv6" >> /etc/modules + +RUN npm install -g pm2 \ + && mkdir -p /home/LogFiles /opt/startup \ + && echo "root:Docker!" | chpasswd \ + && echo "cd /home" >> /etc/bash.bashrc \ + && apt-get update \ + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 +# setup default site +RUN rm -f /etc/ssh/sshd_config +COPY startup /opt/startup +COPY hostingstart.html /opt/startup + +# configure startup +RUN mkdir -p /tmp +COPY sshd_config /etc/ssh/ + +COPY ssh_setup.sh /tmp +RUN chmod -R +x /opt/startup \ + && chmod -R +x /tmp/ssh_setup.sh \ + && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ + && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ + && cd /opt/startup \ + && npm install + +ENV PORT 8080 +ENV SSH_PORT 2222 +EXPOSE 2222 8080 + +ENV PM2HOME /pm2home + +ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance +ENV WEBSITE_INSTANCE_ID localInstance +ENV PATH ${PATH}:/home/site/wwwroot + +WORKDIR /home/site/wwwroot + +ENTRYPOINT ["/opt/startup/init_container.sh"] diff --git a/12.9/hostingstart.html b/12.9/hostingstart.html new file mode 100644 index 0000000..fc225bd --- /dev/null +++ b/12.9/hostingstart.html @@ -0,0 +1 @@ +Microsoft Azure App Service - Welcome

Hey, Node developers!


Your app service is up and running.

Time to take the next step and deploy your code.

Have your code ready?
Use deployment center to get code published from your client or setup continuous deployment.

Don't have your code yet?
Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.

\ No newline at end of file diff --git a/12.9/ssh_setup.sh b/12.9/ssh_setup.sh new file mode 100644 index 0000000..8bc40cc --- /dev/null +++ b/12.9/ssh_setup.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ ! -f "/etc/ssh/ssh_host_rsa_key" ]; then + # generate fresh rsa key + ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa +fi + +if [ ! -f "/etc/ssh/ssh_host_dsa_key" ]; then + # generate fresh dsa key + ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa +fi + +if [ ! -f "/etc/ssh/ssh_host_ecdsa_key" ]; then + # generate fresh ecdsa key + ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t dsa +fi + +if [ ! -f "/etc/ssh/ssh_host_ed25519_key" ]; then + # generate fresh ecdsa key + ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -t dsa +fi + +#prepare run dir +if [ ! -d "/var/run/sshd" ]; then + mkdir -p /var/run/sshd +fi diff --git a/12.9/sshd_config b/12.9/sshd_config new file mode 100644 index 0000000..04b53f9 --- /dev/null +++ b/12.9/sshd_config @@ -0,0 +1,16 @@ +# This is ssh server systemwide configuration file. +# +# /etc/sshd_config + +Port SSH_PORT +ListenAddress 0.0.0.0 +LoginGraceTime 180 +X11Forwarding yes +Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr +MACs hmac-sha1,hmac-sha1-96 +StrictModes yes +SyslogFacility DAEMON +PasswordAuthentication yes +PermitEmptyPasswords no +PermitRootLogin yes +Subsystem sftp internal-sftp diff --git a/12.9/startup/default-static-site.js b/12.9/startup/default-static-site.js new file mode 100644 index 0000000..123f525 --- /dev/null +++ b/12.9/startup/default-static-site.js @@ -0,0 +1,7 @@ +var express = require('express'); +var server = express(); +var options = { + index: ['index.html','hostingstart.html'] +}; +server.use('/', express.static('/opt/startup', options)); +server.listen(process.env.PORT); diff --git a/12.9/startup/init_container.sh b/12.9/startup/init_container.sh new file mode 100644 index 0000000..bb82fd5 --- /dev/null +++ b/12.9/startup/init_container.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +cat >/etc/motd < + \/ \/ \/ +A P P S E R V I C E O N L I N U X + +Documentation: http://aka.ms/webapp-linux +NodeJS quickstart: https://aka.ms/node-qs +NodeJS Version : `node --version` + +EOL +cat /etc/motd + +mkdir "$PM2HOME" +chmod 777 "$PM2HOME" +ln -s /home/LogFiles "$PM2HOME"/logs + +# Get environment variables to show up in SSH session +eval $(printenv | sed -n "s/^\([^=]\+\)=\(.*\)$/export \1=\2/p" | sed 's/"/\\\"/g' | sed '/=/s//="/' | sed 's/$/"/' >> /etc/profile) + +# starting sshd process +sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config +/usr/sbin/sshd + +STARTUP_COMMAND_PATH="/opt/startup/startup.sh" +ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" + +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then + ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then + ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" +fi + +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then + # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in + # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. + echo 'Fixing up path' + export PATH=/node_modules/.bin:$PATH + echo "$PATH" +fi + +eval oryx $ORYX_ARGS + +STARTUPCOMMAND=$(cat $STARTUP_COMMAND_PATH) +echo "Running $STARTUPCOMMAND" +$STARTUP_COMMAND_PATH diff --git a/12.9/startup/npm-shrinkwrap.json b/12.9/startup/npm-shrinkwrap.json new file mode 100644 index 0000000..5eef997 --- /dev/null +++ b/12.9/startup/npm-shrinkwrap.json @@ -0,0 +1,216 @@ +{ + "name": "default-static-site", + "version": "1.0.0", + "dependencies": { + "accepts": { + "version": "1.3.3", + "from": "accepts@>=1.3.3 <1.4.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz" + }, + "array-flatten": { + "version": "1.1.1", + "from": "array-flatten@1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz" + }, + "content-disposition": { + "version": "0.5.2", + "from": "content-disposition@0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz" + }, + "content-type": { + "version": "1.0.2", + "from": "content-type@>=1.0.2 <1.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz" + }, + "cookie": { + "version": "0.3.1", + "from": "cookie@0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz" + }, + "cookie-signature": { + "version": "1.0.6", + "from": "cookie-signature@1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" + }, + "debug": { + "version": "2.6.7", + "from": "debug@2.6.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz" + }, + "depd": { + "version": "1.1.0", + "from": "depd@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz" + }, + "destroy": { + "version": "1.0.4", + "from": "destroy@>=1.0.4 <1.1.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz" + }, + "ee-first": { + "version": "1.1.1", + "from": "ee-first@1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" + }, + "encodeurl": { + "version": "1.0.1", + "from": "encodeurl@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz" + }, + "escape-html": { + "version": "1.0.3", + "from": "escape-html@>=1.0.3 <1.1.0", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz" + }, + "etag": { + "version": "1.8.0", + "from": "etag@>=1.8.0 <1.9.0", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz" + }, + "express": { + "version": "4.15.3", + "from": "express@4.15.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.15.3.tgz" + }, + "finalhandler": { + "version": "1.0.3", + "from": "finalhandler@>=1.0.3 <1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.3.tgz" + }, + "forwarded": { + "version": "0.1.0", + "from": "forwarded@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.0.tgz" + }, + "fresh": { + "version": "0.5.0", + "from": "fresh@0.5.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz" + }, + "http-errors": { + "version": "1.6.1", + "from": "http-errors@>=1.6.1 <1.7.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz" + }, + "inherits": { + "version": "2.0.3", + "from": "inherits@2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + }, + "ipaddr.js": { + "version": "1.3.0", + "from": "ipaddr.js@1.3.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.3.0.tgz" + }, + "media-typer": { + "version": "0.3.0", + "from": "media-typer@0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" + }, + "merge-descriptors": { + "version": "1.0.1", + "from": "merge-descriptors@1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz" + }, + "methods": { + "version": "1.1.2", + "from": "methods@>=1.1.2 <1.2.0", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz" + }, + "mime": { + "version": "1.3.4", + "from": "mime@1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz" + }, + "mime-db": { + "version": "1.27.0", + "from": "mime-db@>=1.27.0 <1.28.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz" + }, + "mime-types": { + "version": "2.1.15", + "from": "mime-types@>=2.1.11 <2.2.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz" + }, + "ms": { + "version": "2.0.0", + "from": "ms@2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + }, + "negotiator": { + "version": "0.6.1", + "from": "negotiator@0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz" + }, + "on-finished": { + "version": "2.3.0", + "from": "on-finished@>=2.3.0 <2.4.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz" + }, + "parseurl": { + "version": "1.3.1", + "from": "parseurl@>=1.3.1 <1.4.0", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz" + }, + "path-to-regexp": { + "version": "0.1.7", + "from": "path-to-regexp@0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz" + }, + "proxy-addr": { + "version": "1.1.4", + "from": "proxy-addr@>=1.1.4 <1.2.0", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.4.tgz" + }, + "qs": { + "version": "6.4.0", + "from": "qs@6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz" + }, + "range-parser": { + "version": "1.2.0", + "from": "range-parser@>=1.2.0 <1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz" + }, + "send": { + "version": "0.15.3", + "from": "send@0.15.3", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.3.tgz" + }, + "serve-static": { + "version": "1.12.3", + "from": "serve-static@1.12.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz" + }, + "setprototypeof": { + "version": "1.0.3", + "from": "setprototypeof@1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz" + }, + "statuses": { + "version": "1.3.1", + "from": "statuses@>=1.3.1 <1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz" + }, + "type-is": { + "version": "1.6.15", + "from": "type-is@>=1.6.15 <1.7.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz" + }, + "unpipe": { + "version": "1.0.0", + "from": "unpipe@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" + }, + "utils-merge": { + "version": "1.0.0", + "from": "utils-merge@1.0.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz" + }, + "vary": { + "version": "1.1.1", + "from": "vary@>=1.1.1 <1.2.0", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz" + } + } +} diff --git a/12.9/startup/package.json b/12.9/startup/package.json new file mode 100644 index 0000000..9cf0726 --- /dev/null +++ b/12.9/startup/package.json @@ -0,0 +1,15 @@ +{ + "name": "default-static-site", + "version": "1.0.0", + "description": "Express-driven static site hosted from default App Service wwwroot directory", + "main": "default-static-site.js", + "dependencies": { + "express": "4.15.3" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Azure App Services Container Images ", + "license": "Apache-2.0" +} diff --git a/12/Dockerfile b/12/Dockerfile new file mode 100644 index 0000000..b7a0ec4 --- /dev/null +++ b/12/Dockerfile @@ -0,0 +1,53 @@ +FROM mcr.microsoft.com/oryx/node:12-20191018.1 +LABEL maintainer="Azure App Services Container Images " + +RUN echo "ipv6" >> /etc/modules + +RUN npm install -g pm2 \ + && mkdir -p /home/LogFiles /opt/startup \ + && echo "root:Docker!" | chpasswd \ + && echo "cd /home" >> /etc/bash.bashrc \ + && apt-get update \ + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 +# setup default site +RUN rm -f /etc/ssh/sshd_config +COPY startup /opt/startup +COPY hostingstart.html /opt/startup + +# configure startup +RUN mkdir -p /tmp +COPY sshd_config /etc/ssh/ + +COPY ssh_setup.sh /tmp +RUN chmod -R +x /opt/startup \ + && chmod -R +x /tmp/ssh_setup.sh \ + && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ + && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ + && cd /opt/startup \ + && npm install + +ENV PORT 8080 +ENV SSH_PORT 2222 +EXPOSE 2222 8080 + +ENV PM2HOME /pm2home + +ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance +ENV WEBSITE_INSTANCE_ID localInstance +ENV PATH ${PATH}:/home/site/wwwroot + +WORKDIR /home/site/wwwroot + +ENTRYPOINT ["/opt/startup/init_container.sh"] diff --git a/12/hostingstart.html b/12/hostingstart.html new file mode 100644 index 0000000..fc225bd --- /dev/null +++ b/12/hostingstart.html @@ -0,0 +1 @@ +Microsoft Azure App Service - Welcome

Hey, Node developers!


Your app service is up and running.

Time to take the next step and deploy your code.

Have your code ready?
Use deployment center to get code published from your client or setup continuous deployment.

Don't have your code yet?
Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.

\ No newline at end of file diff --git a/12/ssh_setup.sh b/12/ssh_setup.sh new file mode 100644 index 0000000..8bc40cc --- /dev/null +++ b/12/ssh_setup.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ ! -f "/etc/ssh/ssh_host_rsa_key" ]; then + # generate fresh rsa key + ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa +fi + +if [ ! -f "/etc/ssh/ssh_host_dsa_key" ]; then + # generate fresh dsa key + ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa +fi + +if [ ! -f "/etc/ssh/ssh_host_ecdsa_key" ]; then + # generate fresh ecdsa key + ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t dsa +fi + +if [ ! -f "/etc/ssh/ssh_host_ed25519_key" ]; then + # generate fresh ecdsa key + ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -t dsa +fi + +#prepare run dir +if [ ! -d "/var/run/sshd" ]; then + mkdir -p /var/run/sshd +fi diff --git a/12/sshd_config b/12/sshd_config new file mode 100644 index 0000000..04b53f9 --- /dev/null +++ b/12/sshd_config @@ -0,0 +1,16 @@ +# This is ssh server systemwide configuration file. +# +# /etc/sshd_config + +Port SSH_PORT +ListenAddress 0.0.0.0 +LoginGraceTime 180 +X11Forwarding yes +Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr +MACs hmac-sha1,hmac-sha1-96 +StrictModes yes +SyslogFacility DAEMON +PasswordAuthentication yes +PermitEmptyPasswords no +PermitRootLogin yes +Subsystem sftp internal-sftp diff --git a/12/startup/default-static-site.js b/12/startup/default-static-site.js new file mode 100644 index 0000000..123f525 --- /dev/null +++ b/12/startup/default-static-site.js @@ -0,0 +1,7 @@ +var express = require('express'); +var server = express(); +var options = { + index: ['index.html','hostingstart.html'] +}; +server.use('/', express.static('/opt/startup', options)); +server.listen(process.env.PORT); diff --git a/12/startup/init_container.sh b/12/startup/init_container.sh new file mode 100644 index 0000000..bb82fd5 --- /dev/null +++ b/12/startup/init_container.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +cat >/etc/motd < + \/ \/ \/ +A P P S E R V I C E O N L I N U X + +Documentation: http://aka.ms/webapp-linux +NodeJS quickstart: https://aka.ms/node-qs +NodeJS Version : `node --version` + +EOL +cat /etc/motd + +mkdir "$PM2HOME" +chmod 777 "$PM2HOME" +ln -s /home/LogFiles "$PM2HOME"/logs + +# Get environment variables to show up in SSH session +eval $(printenv | sed -n "s/^\([^=]\+\)=\(.*\)$/export \1=\2/p" | sed 's/"/\\\"/g' | sed '/=/s//="/' | sed 's/$/"/' >> /etc/profile) + +# starting sshd process +sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config +/usr/sbin/sshd + +STARTUP_COMMAND_PATH="/opt/startup/startup.sh" +ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" + +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then + ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then + ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" +fi + +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then + # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in + # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. + echo 'Fixing up path' + export PATH=/node_modules/.bin:$PATH + echo "$PATH" +fi + +eval oryx $ORYX_ARGS + +STARTUPCOMMAND=$(cat $STARTUP_COMMAND_PATH) +echo "Running $STARTUPCOMMAND" +$STARTUP_COMMAND_PATH diff --git a/12/startup/npm-shrinkwrap.json b/12/startup/npm-shrinkwrap.json new file mode 100644 index 0000000..5eef997 --- /dev/null +++ b/12/startup/npm-shrinkwrap.json @@ -0,0 +1,216 @@ +{ + "name": "default-static-site", + "version": "1.0.0", + "dependencies": { + "accepts": { + "version": "1.3.3", + "from": "accepts@>=1.3.3 <1.4.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz" + }, + "array-flatten": { + "version": "1.1.1", + "from": "array-flatten@1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz" + }, + "content-disposition": { + "version": "0.5.2", + "from": "content-disposition@0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz" + }, + "content-type": { + "version": "1.0.2", + "from": "content-type@>=1.0.2 <1.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz" + }, + "cookie": { + "version": "0.3.1", + "from": "cookie@0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz" + }, + "cookie-signature": { + "version": "1.0.6", + "from": "cookie-signature@1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" + }, + "debug": { + "version": "2.6.7", + "from": "debug@2.6.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz" + }, + "depd": { + "version": "1.1.0", + "from": "depd@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz" + }, + "destroy": { + "version": "1.0.4", + "from": "destroy@>=1.0.4 <1.1.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz" + }, + "ee-first": { + "version": "1.1.1", + "from": "ee-first@1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" + }, + "encodeurl": { + "version": "1.0.1", + "from": "encodeurl@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz" + }, + "escape-html": { + "version": "1.0.3", + "from": "escape-html@>=1.0.3 <1.1.0", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz" + }, + "etag": { + "version": "1.8.0", + "from": "etag@>=1.8.0 <1.9.0", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz" + }, + "express": { + "version": "4.15.3", + "from": "express@4.15.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.15.3.tgz" + }, + "finalhandler": { + "version": "1.0.3", + "from": "finalhandler@>=1.0.3 <1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.3.tgz" + }, + "forwarded": { + "version": "0.1.0", + "from": "forwarded@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.0.tgz" + }, + "fresh": { + "version": "0.5.0", + "from": "fresh@0.5.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz" + }, + "http-errors": { + "version": "1.6.1", + "from": "http-errors@>=1.6.1 <1.7.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz" + }, + "inherits": { + "version": "2.0.3", + "from": "inherits@2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + }, + "ipaddr.js": { + "version": "1.3.0", + "from": "ipaddr.js@1.3.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.3.0.tgz" + }, + "media-typer": { + "version": "0.3.0", + "from": "media-typer@0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" + }, + "merge-descriptors": { + "version": "1.0.1", + "from": "merge-descriptors@1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz" + }, + "methods": { + "version": "1.1.2", + "from": "methods@>=1.1.2 <1.2.0", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz" + }, + "mime": { + "version": "1.3.4", + "from": "mime@1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz" + }, + "mime-db": { + "version": "1.27.0", + "from": "mime-db@>=1.27.0 <1.28.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz" + }, + "mime-types": { + "version": "2.1.15", + "from": "mime-types@>=2.1.11 <2.2.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz" + }, + "ms": { + "version": "2.0.0", + "from": "ms@2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + }, + "negotiator": { + "version": "0.6.1", + "from": "negotiator@0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz" + }, + "on-finished": { + "version": "2.3.0", + "from": "on-finished@>=2.3.0 <2.4.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz" + }, + "parseurl": { + "version": "1.3.1", + "from": "parseurl@>=1.3.1 <1.4.0", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz" + }, + "path-to-regexp": { + "version": "0.1.7", + "from": "path-to-regexp@0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz" + }, + "proxy-addr": { + "version": "1.1.4", + "from": "proxy-addr@>=1.1.4 <1.2.0", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.4.tgz" + }, + "qs": { + "version": "6.4.0", + "from": "qs@6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz" + }, + "range-parser": { + "version": "1.2.0", + "from": "range-parser@>=1.2.0 <1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz" + }, + "send": { + "version": "0.15.3", + "from": "send@0.15.3", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.3.tgz" + }, + "serve-static": { + "version": "1.12.3", + "from": "serve-static@1.12.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz" + }, + "setprototypeof": { + "version": "1.0.3", + "from": "setprototypeof@1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz" + }, + "statuses": { + "version": "1.3.1", + "from": "statuses@>=1.3.1 <1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz" + }, + "type-is": { + "version": "1.6.15", + "from": "type-is@>=1.6.15 <1.7.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz" + }, + "unpipe": { + "version": "1.0.0", + "from": "unpipe@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" + }, + "utils-merge": { + "version": "1.0.0", + "from": "utils-merge@1.0.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz" + }, + "vary": { + "version": "1.1.1", + "from": "vary@>=1.1.1 <1.2.0", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz" + } + } +} diff --git a/12/startup/package.json b/12/startup/package.json new file mode 100644 index 0000000..9cf0726 --- /dev/null +++ b/12/startup/package.json @@ -0,0 +1,15 @@ +{ + "name": "default-static-site", + "version": "1.0.0", + "description": "Express-driven static site hosted from default App Service wwwroot directory", + "main": "default-static-site.js", + "dependencies": { + "express": "4.15.3" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Azure App Services Container Images ", + "license": "Apache-2.0" +} diff --git a/4.4/Dockerfile b/4.4/Dockerfile index 26bdca1..0d63fad 100644 --- a/4.4/Dockerfile +++ b/4.4/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:4.4-20190730.1 +FROM mcr.microsoft.com/oryx/node:4.4-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/4.4/startup/init_container.sh b/4.4/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/4.4/startup/init_container.sh +++ b/4.4/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/4.5/Dockerfile b/4.5/Dockerfile index 833fd7f..a2c22ba 100644 --- a/4.5/Dockerfile +++ b/4.5/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:4.5-20190730.1 +FROM mcr.microsoft.com/oryx/node:4.5-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/4.5/startup/init_container.sh b/4.5/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/4.5/startup/init_container.sh +++ b/4.5/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/4.8/Dockerfile b/4.8/Dockerfile index ecd38e8..96daf14 100644 --- a/4.8/Dockerfile +++ b/4.8/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:4.8-20190730.1 +FROM mcr.microsoft.com/oryx/node:4.8-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/4.8/startup/init_container.sh b/4.8/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/4.8/startup/init_container.sh +++ b/4.8/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/6.10/Dockerfile b/6.10/Dockerfile index 621516b..1a8f022 100644 --- a/6.10/Dockerfile +++ b/6.10/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:6.10-20190730.1 +FROM mcr.microsoft.com/oryx/node:6.10-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/6.10/startup/init_container.sh b/6.10/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/6.10/startup/init_container.sh +++ b/6.10/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/6.11/Dockerfile b/6.11/Dockerfile index ff5394e..0290280 100644 --- a/6.11/Dockerfile +++ b/6.11/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:6.11-20190730.1 +FROM mcr.microsoft.com/oryx/node:6.11-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/6.11/startup/init_container.sh b/6.11/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/6.11/startup/init_container.sh +++ b/6.11/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/6.2/Dockerfile b/6.2/Dockerfile index 7229693..8bd38d5 100644 --- a/6.2/Dockerfile +++ b/6.2/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:6.2-20190730.1 +FROM mcr.microsoft.com/oryx/node:6.2-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/6.2/startup/init_container.sh b/6.2/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/6.2/startup/init_container.sh +++ b/6.2/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/6.6/Dockerfile b/6.6/Dockerfile index 8082e67..e732a76 100644 --- a/6.6/Dockerfile +++ b/6.6/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:6.6-20190730.1 +FROM mcr.microsoft.com/oryx/node:6.6-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/6.6/startup/init_container.sh b/6.6/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/6.6/startup/init_container.sh +++ b/6.6/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/6.9/Dockerfile b/6.9/Dockerfile index a6e31e6..d2eea2b 100644 --- a/6.9/Dockerfile +++ b/6.9/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:6.9-20190730.1 +FROM mcr.microsoft.com/oryx/node:6.9-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/6.9/startup/init_container.sh b/6.9/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/6.9/startup/init_container.sh +++ b/6.9/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/6/Dockerfile b/6/Dockerfile index 8d82c84..bc74b88 100644 --- a/6/Dockerfile +++ b/6/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:6-20190730.1 +FROM mcr.microsoft.com/oryx/node:6-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/6/startup/init_container.sh b/6/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/6/startup/init_container.sh +++ b/6/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 9d228b4..3ddd647 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:8.0-20190730.1 +FROM mcr.microsoft.com/oryx/node:8.0-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/8.0/startup/init_container.sh b/8.0/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/8.0/startup/init_container.sh +++ b/8.0/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/8.1/Dockerfile b/8.1/Dockerfile index ebd22dc..18fb3f2 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:8.1-20190730.1 +FROM mcr.microsoft.com/oryx/node:8.1-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/8.1/startup/init_container.sh b/8.1/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/8.1/startup/init_container.sh +++ b/8.1/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/8.11/Dockerfile b/8.11/Dockerfile index d38fdb8..a87bfa5 100644 --- a/8.11/Dockerfile +++ b/8.11/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:8.11-20190730.1 +FROM mcr.microsoft.com/oryx/node:8.11-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/8.11/startup/init_container.sh b/8.11/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/8.11/startup/init_container.sh +++ b/8.11/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/8.12/Dockerfile b/8.12/Dockerfile index cf033fc..9319dde 100644 --- a/8.12/Dockerfile +++ b/8.12/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:8.12-20190730.1 +FROM mcr.microsoft.com/oryx/node:8.12-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/8.12/startup/init_container.sh b/8.12/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/8.12/startup/init_container.sh +++ b/8.12/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 7c5e98c..714e3f9 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:8.2-20190730.1 +FROM mcr.microsoft.com/oryx/node:8.2-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/8.2/startup/init_container.sh b/8.2/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/8.2/startup/init_container.sh +++ b/8.2/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/8.8/Dockerfile b/8.8/Dockerfile index 82dc10b..3be0135 100644 --- a/8.8/Dockerfile +++ b/8.8/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:8.8-20190730.1 +FROM mcr.microsoft.com/oryx/node:8.8-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/8.8/startup/init_container.sh b/8.8/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/8.8/startup/init_container.sh +++ b/8.8/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/8.9/Dockerfile b/8.9/Dockerfile index 125d938..14445b5 100644 --- a/8.9/Dockerfile +++ b/8.9/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:8.9-20190730.1 +FROM mcr.microsoft.com/oryx/node:8.9-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/8.9/startup/init_container.sh b/8.9/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/8.9/startup/init_container.sh +++ b/8.9/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/8/Dockerfile b/8/Dockerfile index 0abb57e..d6b4574 100644 --- a/8/Dockerfile +++ b/8/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:8-20190730.1 +FROM mcr.microsoft.com/oryx/node:8-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/8/startup/init_container.sh b/8/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/8/startup/init_container.sh +++ b/8/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path' diff --git a/9.4/Dockerfile b/9.4/Dockerfile index 05230a2..c6e312d 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oryx/node:9.4-20190730.1 +FROM mcr.microsoft.com/oryx/node:9.4-20191018.1 LABEL maintainer="Azure App Services Container Images " RUN echo "ipv6" >> /etc/modules @@ -8,8 +8,18 @@ RUN npm install -g pm2 \ && echo "root:Docker!" | chpasswd \ && echo "cd /home" >> /etc/bash.bashrc \ && apt-get update \ - && apt-get install --yes --no-install-recommends openssh-server vim curl wget tcptraceroute openrc - + && apt-get install --yes --no-install-recommends \ + openssh-server \ + vim \ + curl \ + wget \ + tcptraceroute \ + openrc \ + yarn \ + net-tools \ + dnsutils \ + tcpdump \ + iproute2 # setup default site RUN rm -f /etc/ssh/sshd_config COPY startup /opt/startup @@ -24,6 +34,7 @@ RUN chmod -R +x /opt/startup \ && chmod -R +x /tmp/ssh_setup.sh \ && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ && rm -rf /tmp/* \ + && echo "cd /home" >> /root/.bashrc \ && cd /opt/startup \ && npm install diff --git a/9.4/startup/init_container.sh b/9.4/startup/init_container.sh index 0e4b3d0..bb82fd5 100644 --- a/9.4/startup/init_container.sh +++ b/9.4/startup/init_container.sh @@ -29,13 +29,13 @@ sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config STARTUP_COMMAND_PATH="/opt/startup/startup.sh" ORYX_ARGS="-appPath /home/site/wwwroot -output $STARTUP_COMMAND_PATH -usePM2 -defaultApp=/opt/startup/default-static-site.js -userStartupCommand '$@'" -if [ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]; then +if [[ $APPSVC_REMOTE_DEBUGGING == "TRUE" ]]; then ORYX_ARGS="-remoteDebug -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" -elif [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then +elif [[ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]]; then ORYX_ARGS="-remoteDebugBrk -debugPort $APPSVC_TUNNEL_PORT $ORYX_ARGS" fi -if [ -f "oryx-manifest.toml" ] && [ "$APPSVC_RUN_ZIP" = "TRUE" ]; then +if [ -f "oryx-manifest.toml" ] && [[ "$APPSVC_RUN_ZIP" == "TRUE" ]]; then # NPM adds the current directory's node_modules/.bin folder to PATH before it runs, so commands in # "npm start" can files there. Since we move node_modules, we have to add it to the path ourselves. echo 'Fixing up path'