Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

sync from templates #46

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions 2.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/oryx/python:2.7-20190730.1
FROM mcr.microsoft.com/oryx/python:2.7-20191018.1
LABEL maintainer="[email protected]"

# Web Site Home
Expand All @@ -13,6 +13,10 @@ RUN apt-get update \
wget \
# build-essential \
tcptraceroute \
net-tools \
dnsutils \
tcpdump \
iproute2 \
&& pip install --upgrade pip \
&& pip install gunicorn \
&& pip install virtualenv \
Expand All @@ -28,7 +32,7 @@ ENV SSH_PORT 2222
# setup SSH
RUN mkdir -p /home/LogFiles \
&& echo "root:Docker!" | chpasswd \
&& echo "cd /home" >> /etc/bash.bashrc
&& echo "cd /home" >> /root/.bashrc

COPY sshd_config /etc/ssh/
RUN mkdir -p /opt/startup
Expand All @@ -37,6 +41,7 @@ COPY init_container.sh /opt/startup/init_container.sh
# setup default site
RUN mkdir /opt/defaultsite
COPY hostingstart.html /opt/defaultsite
COPY hostingstart_dep.html /opt/defaultsite
COPY application.py /opt/defaultsite

# configure startup
Expand Down
6 changes: 5 additions & 1 deletion 2.7/application.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from flask import Flask
import os
app = Flask(__name__, static_folder='/opt/defaultsite')

@app.route('/')
def root():
return app.send_static_file('hostingstart.html')
if os.path.isdir('/home/site/deployments') and len(os.walk('/home/site/deployments')[1]) > 1:
return app.send_static_file('hostingstart_dep.html')
else:
return app.send_static_file('hostingstart.html')
1 change: 1 addition & 0 deletions 2.7/hostingstart_dep.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv=X-UA-Compatible content="IE=edge"> <title>Microsoft Azure App Service - Welcome</title> <link rel="SHORTCUT ICON" href="https://c.s-microsoft.com/favicon.ico?v2" type="image/x-icon"/> <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/4.1.1/css/bootstrap.min.css" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="https://appservice.azureedge.net/css/linux-landing-page/v3/main.css"> <script type="text/javascript">window.onload=function(){try{var a=window.location.hostname;if(a.includes(".azurewebsites.net")){a=a.replace(".azurewebsites.net", "")}var b=document.getElementById("depCenterLink");b.setAttribute("href", b.getAttribute("href") + "&sitename=" + a);}catch(d){}}</script> </head> <body> <nav class="navbar navbar-light bg-light"> <a class="navbar-brand " href="#"> <div class="container pl-4 ml-5"> <img src="https://appservice.azureedge.net/images/linux-landing-page/v3/microsoft_azure_logo.png" width="270" height="108" alt=""> </div></a> </nav> <div class="container-fluid container-height mr-2"> <div class="pt-10 pb-10 mt-10 mb-10 d-xxs-none d-xs-none d-sm-none d-md-none d-lg-block d-xl-block" style="height:20px; width:100%; clear:both;"></div><div class="row"> <div class="row col-xs-12 col-sm-12 d-block d-lg-none d-xl-none d-md-block d-sm-block d-xs-block"> <div class="text-center"> <img src="https://appservice.azureedge.net/images/linux-landing-page/v3/python.svg"> </div></div><div class="extra-pl-small-scr offset-xl-1 offset-lg-1 offset-md-2 offset-sm-2 offset-xs-2 col-xl-5 col-lg-5 col-md-10 col-sm-11 col-xs-11 div-vertical-center"> <div class="container-fluid"> <div class="row"> <h2>Hey, Python developers!</h2> </div><br><div class="row"> <h4>Your app service is up and running.</h4> </div><div class="row"> <h4>Time to take the next step and deploy your code.</h4> </div><div class="row info-mg-top"> <p class=" pl-0 col-md-6 col-sm-12 info-mg-top">Have your code ready?<br>Use deployment center to get code published from your client or setup continuous deployment.<br><a id='depCenterLink' href="https://go.microsoft.com/fwlink/?linkid=2057852"><button class="btn btn-primary btn-mg-top" type="submit">Deployment Center</button></a></p><p class="pl-0 offset-md-1 col-md-5 col-sm-12 info-mg-top">Don't have your code yet?<br>Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.<br><button onclick="location.href='https://go.microsoft.com/fwlink/?linkid=2057226'" class="btn btn-primary btn-mg-top" type="submit">Quickstart</button></p></div><div class="row" id='startupLearnLink'> <p class=" pl-0 col-md-12 col-sm-12 info-mg-top">Expecting to see you app? You may need to configure your startup process. &nbsp;&nbsp;<a href="https://go.microsoft.com/fwlink/?linkid=2105078">Learn more</a><br></p></div></div></div><div class="col-xl-5 col-lg-5 col-md-12 d-none d-lg-block"> <div class="text-center"> <img src="https://appservice.azureedge.net/images/linux-landing-page/v3/python.svg"> </div></div><div class="col-xl-1 col-lg-1 col-md-1"></div></div></div><script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.2.1.min.js" crossorigin="anonymous"></script><script src="https://ajax.aspnetcdn.com/ajax/bootstrap/4.1.1/bootstrap.min.js" crossorigin="anonymous"></script> </body></html>
12 changes: 12 additions & 0 deletions 2.7/init_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ else
fi
fi

debugArgs=""
if [ "$APPSVC_REMOTE_DEBUGGING" == "TRUE" ]; then
echo "App will launch in debug mode"
debugArgs="-debugAdapter ptvsd -debugPort $APPSVC_TUNNEL_PORT"

if [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then
debugArgs+=" -debugWait"
fi

oryxArgs="$debugArgs $oryxArgs"
fi

echo "Launching oryx with: $oryxArgs"
#invoke oryx to generate startup script
eval "oryx $oryxArgs"
Expand Down
9 changes: 7 additions & 2 deletions 3.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/oryx/python:3.6-20190730.1
FROM mcr.microsoft.com/oryx/python:3.6-20191018.1
LABEL maintainer="[email protected]"

# Web Site Home
Expand All @@ -12,6 +12,10 @@ RUN apt-get update \
curl \
wget \
tcptraceroute \
net-tools \
dnsutils \
tcpdump \
iproute2 \
&& pip install --upgrade pip \
&& pip install subprocess32 \
&& pip install gunicorn \
Expand All @@ -27,7 +31,7 @@ ENV SSH_PORT 2222
# setup SSH
RUN mkdir -p /home/LogFiles \
&& echo "root:Docker!" | chpasswd \
&& echo "cd /home" >> /etc/bash.bashrc
&& echo "cd /home" >> /root/.bashrc

COPY sshd_config /etc/ssh/
RUN mkdir -p /opt/startup
Expand All @@ -36,6 +40,7 @@ COPY init_container.sh /opt/startup/init_container.sh
# setup default site
RUN mkdir /opt/defaultsite
COPY hostingstart.html /opt/defaultsite
COPY hostingstart_dep.html /opt/defaultsite
COPY application.py /opt/defaultsite

# configure startup
Expand Down
6 changes: 5 additions & 1 deletion 3.6/application.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from flask import Flask
import os
app = Flask(__name__, static_folder='/opt/defaultsite')

@app.route('/')
def root():
return app.send_static_file('hostingstart.html')
if os.path.isdir('/home/site/deployments') and len(next(os.walk('/home/site/deployments'))[1]) > 1:
return app.send_static_file('hostingstart_dep.html')
else:
return app.send_static_file('hostingstart.html')
1 change: 1 addition & 0 deletions 3.6/hostingstart_dep.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv=X-UA-Compatible content="IE=edge"> <title>Microsoft Azure App Service - Welcome</title> <link rel="SHORTCUT ICON" href="https://c.s-microsoft.com/favicon.ico?v2" type="image/x-icon"/> <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/4.1.1/css/bootstrap.min.css" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="https://appservice.azureedge.net/css/linux-landing-page/v3/main.css"> <script type="text/javascript">window.onload=function(){try{var a=window.location.hostname;if(a.includes(".azurewebsites.net")){a=a.replace(".azurewebsites.net", "")}var b=document.getElementById("depCenterLink");b.setAttribute("href", b.getAttribute("href") + "&sitename=" + a);}catch(d){}}</script> </head> <body> <nav class="navbar navbar-light bg-light"> <a class="navbar-brand " href="#"> <div class="container pl-4 ml-5"> <img src="https://appservice.azureedge.net/images/linux-landing-page/v3/microsoft_azure_logo.png" width="270" height="108" alt=""> </div></a> </nav> <div class="container-fluid container-height mr-2"> <div class="pt-10 pb-10 mt-10 mb-10 d-xxs-none d-xs-none d-sm-none d-md-none d-lg-block d-xl-block" style="height:20px; width:100%; clear:both;"></div><div class="row"> <div class="row col-xs-12 col-sm-12 d-block d-lg-none d-xl-none d-md-block d-sm-block d-xs-block"> <div class="text-center"> <img src="https://appservice.azureedge.net/images/linux-landing-page/v3/python.svg"> </div></div><div class="extra-pl-small-scr offset-xl-1 offset-lg-1 offset-md-2 offset-sm-2 offset-xs-2 col-xl-5 col-lg-5 col-md-10 col-sm-11 col-xs-11 div-vertical-center"> <div class="container-fluid"> <div class="row"> <h2>Hey, Python developers!</h2> </div><br><div class="row"> <h4>Your app service is up and running.</h4> </div><div class="row"> <h4>Time to take the next step and deploy your code.</h4> </div><div class="row info-mg-top"> <p class=" pl-0 col-md-6 col-sm-12 info-mg-top">Have your code ready?<br>Use deployment center to get code published from your client or setup continuous deployment.<br><a id='depCenterLink' href="https://go.microsoft.com/fwlink/?linkid=2057852"><button class="btn btn-primary btn-mg-top" type="submit">Deployment Center</button></a></p><p class="pl-0 offset-md-1 col-md-5 col-sm-12 info-mg-top">Don't have your code yet?<br>Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.<br><button onclick="location.href='https://go.microsoft.com/fwlink/?linkid=2057226'" class="btn btn-primary btn-mg-top" type="submit">Quickstart</button></p></div><div class="row" id='startupLearnLink'> <p class=" pl-0 col-md-12 col-sm-12 info-mg-top">Expecting to see you app? You may need to configure your startup process. &nbsp;&nbsp;<a href="https://go.microsoft.com/fwlink/?linkid=2105078">Learn more</a><br></p></div></div></div><div class="col-xl-5 col-lg-5 col-md-12 d-none d-lg-block"> <div class="text-center"> <img src="https://appservice.azureedge.net/images/linux-landing-page/v3/python.svg"> </div></div><div class="col-xl-1 col-lg-1 col-md-1"></div></div></div><script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.2.1.min.js" crossorigin="anonymous"></script><script src="https://ajax.aspnetcdn.com/ajax/bootstrap/4.1.1/bootstrap.min.js" crossorigin="anonymous"></script> </body></html>
12 changes: 12 additions & 0 deletions 3.6/init_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ else
fi
fi

debugArgs=""
if [ "$APPSVC_REMOTE_DEBUGGING" == "TRUE" ]; then
echo "App will launch in debug mode"
debugArgs="-debugAdapter ptvsd -debugPort $APPSVC_TUNNEL_PORT"

if [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then
debugArgs+=" -debugWait"
fi

oryxArgs="$debugArgs $oryxArgs"
fi

echo "Launching oryx with: $oryxArgs"
#invoke oryx to generate startup script
eval "oryx $oryxArgs"
Expand Down
11 changes: 8 additions & 3 deletions 3.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/oryx/python:3.7-20190730.1
FROM mcr.microsoft.com/oryx/python:3.7-20191018.1
LABEL maintainer="[email protected]"

# Web Site Home
Expand All @@ -12,6 +12,10 @@ RUN apt-get update \
curl \
wget \
tcptraceroute \
net-tools \
dnsutils \
tcpdump \
iproute2 \
&& pip install --upgrade pip \
&& pip install subprocess32 \
&& pip install gunicorn \
Expand All @@ -27,15 +31,16 @@ ENV SSH_PORT 2222
# setup SSH
RUN mkdir -p /home/LogFiles \
&& echo "root:Docker!" | chpasswd \
&& echo "cd /home" >> /etc/bash.bashrc

&& echo "cd /home" >> /root/.bashrc
COPY sshd_config /etc/ssh/
RUN mkdir -p /opt/startup
COPY init_container.sh /opt/startup/init_container.sh

# setup default site
RUN mkdir /opt/defaultsite
COPY hostingstart.html /opt/defaultsite
COPY hostingstart_dep.html /opt/defaultsite
COPY application.py /opt/defaultsite

# configure startup
Expand Down
6 changes: 5 additions & 1 deletion 3.7/application.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from flask import Flask
import os
app = Flask(__name__, static_folder='/opt/defaultsite')

@app.route('/')
def root():
return app.send_static_file('hostingstart.html')
if os.path.isdir('/home/site/deployments') and len(next(os.walk('/home/site/deployments'))[1]) > 1:
return app.send_static_file('hostingstart_dep.html')
else:
return app.send_static_file('hostingstart.html')
1 change: 1 addition & 0 deletions 3.7/hostingstart_dep.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv=X-UA-Compatible content="IE=edge"> <title>Microsoft Azure App Service - Welcome</title> <link rel="SHORTCUT ICON" href="https://c.s-microsoft.com/favicon.ico?v2" type="image/x-icon"/> <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/4.1.1/css/bootstrap.min.css" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="https://appservice.azureedge.net/css/linux-landing-page/v3/main.css"> <script type="text/javascript">window.onload=function(){try{var a=window.location.hostname;if(a.includes(".azurewebsites.net")){a=a.replace(".azurewebsites.net", "")}var b=document.getElementById("depCenterLink");b.setAttribute("href", b.getAttribute("href") + "&sitename=" + a);}catch(d){}}</script> </head> <body> <nav class="navbar navbar-light bg-light"> <a class="navbar-brand " href="#"> <div class="container pl-4 ml-5"> <img src="https://appservice.azureedge.net/images/linux-landing-page/v3/microsoft_azure_logo.png" width="270" height="108" alt=""> </div></a> </nav> <div class="container-fluid container-height mr-2"> <div class="pt-10 pb-10 mt-10 mb-10 d-xxs-none d-xs-none d-sm-none d-md-none d-lg-block d-xl-block" style="height:20px; width:100%; clear:both;"></div><div class="row"> <div class="row col-xs-12 col-sm-12 d-block d-lg-none d-xl-none d-md-block d-sm-block d-xs-block"> <div class="text-center"> <img src="https://appservice.azureedge.net/images/linux-landing-page/v3/python.svg"> </div></div><div class="extra-pl-small-scr offset-xl-1 offset-lg-1 offset-md-2 offset-sm-2 offset-xs-2 col-xl-5 col-lg-5 col-md-10 col-sm-11 col-xs-11 div-vertical-center"> <div class="container-fluid"> <div class="row"> <h2>Hey, Python developers!</h2> </div><br><div class="row"> <h4>Your app service is up and running.</h4> </div><div class="row"> <h4>Time to take the next step and deploy your code.</h4> </div><div class="row info-mg-top"> <p class=" pl-0 col-md-6 col-sm-12 info-mg-top">Have your code ready?<br>Use deployment center to get code published from your client or setup continuous deployment.<br><a id='depCenterLink' href="https://go.microsoft.com/fwlink/?linkid=2057852"><button class="btn btn-primary btn-mg-top" type="submit">Deployment Center</button></a></p><p class="pl-0 offset-md-1 col-md-5 col-sm-12 info-mg-top">Don't have your code yet?<br>Follow our quickstart guide and you'll have a full app ready in 5 minutes or less.<br><button onclick="location.href='https://go.microsoft.com/fwlink/?linkid=2057226'" class="btn btn-primary btn-mg-top" type="submit">Quickstart</button></p></div><div class="row" id='startupLearnLink'> <p class=" pl-0 col-md-12 col-sm-12 info-mg-top">Expecting to see you app? You may need to configure your startup process. &nbsp;&nbsp;<a href="https://go.microsoft.com/fwlink/?linkid=2105078">Learn more</a><br></p></div></div></div><div class="col-xl-5 col-lg-5 col-md-12 d-none d-lg-block"> <div class="text-center"> <img src="https://appservice.azureedge.net/images/linux-landing-page/v3/python.svg"> </div></div><div class="col-xl-1 col-lg-1 col-md-1"></div></div></div><script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.2.1.min.js" crossorigin="anonymous"></script><script src="https://ajax.aspnetcdn.com/ajax/bootstrap/4.1.1/bootstrap.min.js" crossorigin="anonymous"></script> </body></html>
13 changes: 12 additions & 1 deletion 3.7/init_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ eval $(printenv | sed -n "s/^\([^=]\+\)=\(.*\)$/export \1=\2/p" | sed 's/"/\\\"/
echo "$@" > /opt/startup/startupCommand
chmod 755 /opt/startup/startupCommand

#oryx startup script generator
oryxArgs="-appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -bindPort $PORT"
if [ $# -eq 0 ]; then
echo 'App Command Line not configured, will attempt auto-detect'
Expand Down Expand Up @@ -55,6 +54,18 @@ else
fi
fi

debugArgs=""
if [ "$APPSVC_REMOTE_DEBUGGING" == "TRUE" ]; then
echo "App will launch in debug mode"
debugArgs="-debugAdapter ptvsd -debugPort $APPSVC_TUNNEL_PORT"

if [ "$APPSVC_REMOTE_DEBUGGING_BREAK" == "TRUE" ]; then
debugArgs+=" -debugWait"
fi

oryxArgs="$debugArgs $oryxArgs"
fi

echo "Launching oryx with: $oryxArgs"
#invoke oryx to generate startup script
eval "oryx $oryxArgs"
Expand Down
50 changes: 50 additions & 0 deletions 3.8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM mcr.microsoft.com/oryx/python:3.8-20191018.1
LABEL maintainer="[email protected]"

# Web Site Home
ENV HOME_SITE "/home/site/wwwroot"

#Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
openssh-server \
vim \
curl \
wget \
tcptraceroute \
net-tools \
dnsutils \
tcpdump \
iproute2 \
&& pip install --upgrade pip \
&& pip install subprocess32 \
&& pip install gunicorn \
&& pip install virtualenv \
&& pip install flask

WORKDIR ${HOME_SITE}

EXPOSE 8000
ENV PORT 8000
ENV SSH_PORT 2222

# setup SSH
RUN mkdir -p /home/LogFiles \
&& echo "root:Docker!" | chpasswd \
&& echo "cd /home" >> /root/.bashrc

COPY sshd_config /etc/ssh/
RUN mkdir -p /opt/startup
COPY init_container.sh /opt/startup/init_container.sh

# setup default site
RUN mkdir /opt/defaultsite
COPY hostingstart.html /opt/defaultsite
COPY hostingstart_dep.html /opt/defaultsite
COPY application.py /opt/defaultsite

# configure startup
RUN chmod -R 777 /opt/startup
COPY entrypoint.py /usr/local/bin

ENTRYPOINT ["/opt/startup/init_container.sh"]
10 changes: 10 additions & 0 deletions 3.8/application.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from flask import Flask
import os
app = Flask(__name__, static_folder='/opt/defaultsite')

@app.route('/')
def root():
if os.path.isdir('/home/site/deployments') and len(next(os.walk('/home/site/deployments'))[1]) > 1:
return app.send_static_file('hostingstart_dep.html')
else:
return app.send_static_file('hostingstart.html')
7 changes: 7 additions & 0 deletions 3.8/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -x -e

buildnumber=${4-$(date -u +"%y%m%d%H%M")}

docker build --no-cache -t "$1"/python:3.8_"$buildnumber" .
docker tag "$1"/python:3.7_"$buildnumber" "$1"/python:latest
Loading