add_docker

This commit is contained in:
sugizo
2018-02-05 07:06:40 +07:00
parent 623f3b9947
commit a3df59fceb
115 changed files with 3128 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
FROM alpine:latest
RUN apk add --no-cache python py-pip py-setuptools unzip wget py-gunicorn && \
pip install --upgrade pip && \
pip install virtualenv
RUN addgroup -S web2py && \
adduser -D -S -G web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && /usr/bin/python /home/web2py/web2py/anyserver.py -s gunicorn -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Alpine/web2py-gunicorn
docker build -t username/alpine-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name alpine-web2py-gunicorn username/alpine-web2py-gunicorn
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Alpine/web2py-gunicorn
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Alpine/web2py-gunicorn
docker login -u username
docker build -t username/alpine-web2py-gunicorn .
docker push username/alpine-web2py-gunicorn
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/alpine-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name alpine-web2py-gunicorn username/alpine-web2py-gunicorn
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-gunicorn:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+20
View File
@@ -0,0 +1,20 @@
FROM alpine:latest
RUN apk add --no-cache python py-pip py-setuptools unzip wget openssl && \
pip install --upgrade pip && \
pip install virtualenv
RUN wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /web2py/applications/examples && \
cd /web2py && \
openssl genrsa 1024 > web2py.key && chmod 400 web2py.key && \
openssl req -new -x509 -nodes -sha1 -days 1780 -subj '/C=c/ST=st/L=l/O=o/OU=ou/CN=cn.com' -key web2py.key > web2py.crt && \
openssl x509 -noout -fingerprint -text < web2py.crt > web2py.info && \
chmod 755 -R /web2py
WORKDIR /web2py
EXPOSE 443
CMD python /web2py/web2py.py --nogui --no-banner -a 'a' -c web2py.crt -k web2py.key -i 0.0.0.0 -p 443
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Alpine/web2py-rocket-ssl
docker build -t username/alpine-web2py-rocket-ssl .
docker run -d -v applications:/web2py/applications -p 443:443 --name alpine-web2py-rocket-ssl username/alpine-web2py-rocket-ssl
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Alpine/web2py-rocket-ssl
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Alpine/web2py-rocket-ssl
docker login -u username
docker build -t username/alpine-web2py-rocket-ssl .
docker push username/alpine-web2py-rocket-ssl
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/alpine-web2py-rocket-ssl .
docker run -d -v applications:/web2py/applications -p 443:443 --name alpine-web2py-rocket-ssl username/
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-rocket-ssl:
build: .
ports:
- "443:443"
volumes:
- applications:/web2py/applications
volumes:
applications:
+25
View File
@@ -0,0 +1,25 @@
FROM alpine:latest
RUN apk add --no-cache python py-pip py-setuptools unzip wget && \
pip install --upgrade pip && \
pip install virtualenv
RUN addgroup -S web2py && \
adduser -D -S -G web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && python /home/web2py/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Alpine/web2py-rocket
docker build -t username/alpine-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name alpine-web2py-rocket username/alpine-web2py-rocket
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Alpine/web2py-rocket
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Alpine/web2py-rocket
docker login -u username
docker build -t username/alpine-web2py-rocket .
docker push username/alpine-web2py-rocket
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/alpine-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name alpine-web2py-rocket username/
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-rocket:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+25
View File
@@ -0,0 +1,25 @@
FROM alpine:latest
RUN apk add --no-cache python py-pip py-setuptools unzip wget py-tornado && \
pip install --upgrade pip && \
pip install virtualenv
RUN addgroup -S web2py && \
adduser -D -S -G web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && /usr/bin/python /home/web2py/web2py/anyserver.py -s tornado -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Alpine/web2py-tornado
docker build -t username/alpine-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name alpine-web2py-tornado username/alpine-web2py-tornado
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Alpine/web2py-tornado
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Alpine/web2py-tornado
docker login -u username
docker build -t username/alpine-web2py-tornado .
docker push username/alpine-web2py-tornado
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/alpine-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name alpine-web2py-tornado username/
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-tornado:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+26
View File
@@ -0,0 +1,26 @@
FROM centos:latest
RUN yum install -y epel-release && \
yum install -y python python-pip python-setuptools unzip wget python-gunicorn --nogpgcheck && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && /usr/bin/python /home/web2py/web2py/anyserver.py -s gunicorn -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Centos/web2py-gunicorn
docker build -t username/centos-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name centos-web2py-gunicorn username/centos-web2py-gunicorn
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Centos/web2py-gunicorn
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Centos/web2py-gunicorn
docker login -u username
docker build -t username/centos-web2py-gunicorn .
docker push username/centos-web2py-gunicorn
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/centos-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name centos-web2py-gunicorn username/centos-web2py-gunicorn
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-gunicorn:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+26
View File
@@ -0,0 +1,26 @@
FROM centos:latest
RUN yum install -y epel-release && \
yum install -y python python-pip python-setuptools unzip wget --nogpgcheck && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && python /home/web2py/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Centos/web2py-rocket
docker build -t username/centos-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name centos-web2py-rocket username/centos-web2py-rocket
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Centos/web2py-rocket
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Centos/web2py-rocket
docker login -u username
docker build -t username/centos-web2py-rocket .
docker push username/centos-web2py-rocket
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/centos-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name centos-web2py-rocket username/centos-web2py-rocket
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-rocket:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+26
View File
@@ -0,0 +1,26 @@
FROM centos:latest
RUN yum install -y epel-release && \
yum install -y python python-pip python-setuptools unzip wget python-tornado --nogpgcheck && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && /usr/bin/python /home/web2py/web2py/anyserver.py -s tornado -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Centos/web2py-tornado
docker build -t username/centos-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name centos-web2py-tornado username/centos-web2py-tornado
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Centos/web2py-tornado
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Centos/web2py-tornado
docker login -u username
docker build -t username/centos-web2py-tornado .
docker push username/centos-web2py-tornado
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/centos-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name centos-web2py-tornado username/centos-web2py-tornado
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-tornado:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+26
View File
@@ -0,0 +1,26 @@
FROM debian:latest
RUN apt update && \
apt install -y python python-pip python-setuptools unzip wget gunicorn && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && /usr/bin/python /home/web2py/web2py/anyserver.py -s gunicorn -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Debian/web2py-gunicorn
docker build -t username/debian-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name debian-web2py-gunicorn username/debian-web2py-gunicorn
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Debian/web2py-gunicorn
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Debian/web2py-gunicorn
docker login -u username
docker build -t username/debian-web2py-gunicorn .
docker push username/debian-web2py-gunicorn
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/debian-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name debian-web2py-gunicorn username/debian-web2py-gunicorn
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-gunicorn:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+26
View File
@@ -0,0 +1,26 @@
FROM debian:latest
RUN apt update && \
apt install -y python python-pip python-setuptools unzip wget && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && python /home/web2py/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Debian/web2py-rocket
docker build -t username/debian-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name debian-web2py-rocket username/debian-web2py-rocket
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Debian/web2py-rocket
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Debian/web2py-rocket
docker login -u username
docker build -t username/debian-web2py-rocket .
docker push username/debian-web2py-rocket
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/debian-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name debian-web2py-rocket username/debian-web2py-rocket
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-rocket:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+26
View File
@@ -0,0 +1,26 @@
FROM debian:latest
RUN apt update && \
apt install -y python python-pip python-setuptools unzip wget python-tornado && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && /usr/bin/python /home/web2py/web2py/anyserver.py -s tornado -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Debian/web2py-tornado
docker build -t username/debian-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name debian-web2py-tornado username/debian-web2py-tornado
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Debian/web2py-tornado
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Debian/web2py-tornado
docker login -u username
docker build -t username/debian-web2py-tornado .
docker push username/debian-web2py-tornado
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/debian-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name debian-web2py-tornado username/debian-web2py-tornado
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-tornado:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+25
View File
@@ -0,0 +1,25 @@
FROM fedora:latest
RUN dnf install -y python python-pip python-setuptools unzip wget python-gunicorn --nogpgcheck && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && /usr/bin/python /home/web2py/web2py/anyserver.py -s gunicorn -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Fedora/web2py-gunicorn
docker build -t username/fedora-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name fedora-web2py-gunicorn username/fedora-web2py-gunicorn
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Fedora/web2py-gunicorn
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Fedora/web2py-gunicorn
docker login -u username
docker build -t username/fedora-web2py-gunicorn .
docker push username/fedora-web2py-gunicorn
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/fedora-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name fedora-web2py-gunicorn username/fedora-web2py-gunicorn
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-gunicorn:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+25
View File
@@ -0,0 +1,25 @@
FROM fedora:latest
RUN dnf install -y python python-pip python-setuptools unzip wget --nogpgcheck && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && python /home/web2py/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Fedora/web2py-rocket
docker build -t username/fedora-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name fedora-web2py-rocket username/fedora-web2py-rocket
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Fedora/web2py-rocket
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Fedora/web2py-rocket
docker login -u username
docker build -t username/fedora-web2py-rocket .
docker push username/fedora-web2py-rocket
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/fedora-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name fedora-web2py-rocket username/fedora-web2py-rocket
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-rocket:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+25
View File
@@ -0,0 +1,25 @@
FROM fedora:latest
RUN dnf install -y python python-pip python-setuptools unzip wget python-tornado --nogpgcheck && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && /usr/bin/python /home/web2py/web2py/anyserver.py -s tornado -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/Fedora/web2py-tornado
docker build -t username/fedora-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name fedora-web2py-tornado username/fedora-web2py-tornado
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/Fedora/web2py-tornado
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/Fedora/web2py-tornado
docker login -u username
docker build -t username/fedora-web2py-tornado .
docker push username/fedora-web2py-tornado
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/fedora-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name fedora-web2py-tornado username/fedora-web2py-tornado
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-tornado:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+25
View File
@@ -0,0 +1,25 @@
FROM opensuse:latest
RUN zypper in -y python python-pip python-setuptools unzip wget python-gunicorn && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && /usr/bin/python /home/web2py/web2py/anyserver.py -s gunicorn -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/OpenSuse/web2py-gunicorn
docker build -t username/opensuse-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name opensuse-web2py-gunicorn username/opensuse-web2py-gunicorn
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/OpenSuse/web2py-gunicorn
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/OpenSuse/web2py-gunicorn
docker login -u username
docker build -t username/opensuse-web2py-gunicorn .
docker push username/opensuse-web2py-gunicorn
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/opensuse-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name opensuse-web2py-gunicorn username/opensuse-web2py-gunicorn
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-gunicorn:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+25
View File
@@ -0,0 +1,25 @@
FROM opensuse:latest
RUN zypper in -y python python-pip python-setuptools unzip wget && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && python /home/web2py/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/OpenSuse/web2py-rocket
docker build -t username/opensuse-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name opensuse-web2py-rocket username/opensuse-web2py-rocket
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/OpenSuse/web2py-rocket
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/OpenSuse/web2py-rocket
docker login -u username
docker build -t username/opensuse-web2py-rocket .
docker push username/opensuse-web2py-rocket
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/opensuse-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name opensuse-web2py-rocket username/opensuse-web2py-rocket
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-rocket:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+25
View File
@@ -0,0 +1,25 @@
FROM opensuse:latest
RUN zypper in -y python python-pip python-setuptools unzip wget python-tornado && \
pip install --upgrade pip && \
pip install virtualenv
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && /usr/bin/python /home/web2py/web2py/anyserver.py -s tornado -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/OpenSuse/web2py-tornado
docker build -t username/opensuse-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name opensuse-web2py-tornado username/opensuse-web2py-tornado
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/OpenSuse/web2py-tornado
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/OpenSuse/web2py-tornado
docker login -u username
docker build -t username/opensuse-web2py-tornado .
docker push username/opensuse-web2py-tornado
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/opensuse-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name opensuse-web2py-tornado username/opensuse-web2py-tornado
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-tornado:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+22
View File
@@ -0,0 +1,22 @@
FROM python:2.7
RUN apt update && \
apt install -y unzip wget python-pip && \
pip install gunicorn
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN cd /home/web2py/ && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD python /home/web2py/web2py/anyserver.py -s gunicorn -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/App/web2py-gunicorn
docker build -t username/app-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name app-web2py-gunicorn username/app-web2py-gunicorn
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/App/web2py-gunicorn
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/App/web2py-gunicorn
docker login -u username
docker build -t username/app-web2py-gunicorn .
docker push username/app-web2py-gunicorn
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/app-web2py-gunicorn .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name app-web2py-gunicorn username/app-web2py-gunicorn
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-gunicorn:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+19
View File
@@ -0,0 +1,19 @@
FROM python:2.7
RUN apt update && \
apt install -y unzip wget
RUN wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /web2py/applications/examples && \
cd /web2py && \
openssl genrsa 1024 > web2py.key && chmod 400 web2py.key && \
openssl req -new -x509 -nodes -sha1 -days 1780 -subj '/C=c/ST=st/L=l/O=o/OU=ou/CN=cn.com' -key web2py.key > web2py.crt && \
openssl x509 -noout -fingerprint -text < web2py.crt > web2py.info && \
chmod 755 -R /web2py
WORKDIR /web2py
EXPOSE 443
CMD python /web2py/web2py.py --nogui --no-banner -a 'a' -c web2py.crt -k web2py.key -i 0.0.0.0 -p 443
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/App/web2py-rocket-ssl
docker build -t username/app-web2py-rocket-ssl .
docker run -d -v applications:/web2py/applications -p 443:443 --name app-web2py-rocket-ssl username/app-web2py-rocket-ssl
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/App/web2py-rocket-ssl
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/App/web2py-rocket-ssl
docker login -u username
docker build -t username/app-web2py-rocket-ssl .
docker push username/app-web2py-rocket-ssl
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/app-web2py-rocket-ssl .
docker run -d -v applications:/web2py/applications -p 443:443 --name app-web2py-rocket-ssl username/app-web2py-rocket-ssl
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-rocket-ssl:
build: .
ports:
- "443:443"
volumes:
- applications:/web2py/applications
volumes:
applications:
+21
View File
@@ -0,0 +1,21 @@
FROM python:2.7
RUN apt update && \
apt install -y unzip wget
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN cd /home/web2py/ && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD python /home/web2py/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/App/web2py-rocket
docker build -t username/app-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name app-web2py-rocket username/app-web2py-rocket
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/App/web2py-rocket
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/App/web2py-rocket
docker login -u username
docker build -t username/app-web2py-rocket .
docker push username/app-web2py-rocket
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/app-web2py-rocket .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name app-web2py-rocket username/app-web2py-rocket
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-rocket:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+22
View File
@@ -0,0 +1,22 @@
FROM python:2.7
RUN apt update && \
apt install -y unzip wget python-pip && \
pip install tornado
RUN groupadd -r web2py && \
useradd -m -r -g web2py web2py
USER web2py
RUN cd /home/web2py/ && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD python /home/web2py/web2py/anyserver.py -s tornado -i 0.0.0.0 -p 8000
+41
View File
@@ -0,0 +1,41 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/App/web2py-tornado
docker build -t username/app-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name app-web2py-tornado username/app-web2py-tornado
docker ps
docker volume ls
docker volume inspect applications
# Docker Compose
pip install docker-compose
cd /Docker/App/web2py-tornado
docker-compose up -d
docker-compose ps
docker volume ls
docker volume inspect root_applications
# Docker Cloud
cd /Docker/App/web2py-tornado
docker login -u username
docker build -t username/app-web2py-tornado .
docker push username/app-web2py-tornado
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > Dockerfile
EOF
cat Dockerfile
docker build -t username/app-web2py-tornado .
docker run -d -v applications:/home/web2py/web2py/applications -p 8000:8000 --name app-web2py-tornado username/app-web2py-tornado
docker-compose up -d
docker-compose ps
+12
View File
@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-tornado:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:
+56
View File
@@ -0,0 +1,56 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/App/web2py-gunicorn-nginx
chmod 775 run.sh
./run.sh
# Docker Compose
pip install docker-compose
cd /Docker/App/web2py-gunicorn-nginx
docker-compose up -d
docker-compose ps
docker network ls
docker network inspect root_default
docker volume ls
docker volume inspect root_applications
# Docker Stack
docker swarm init --advertise-addr $(hostname -i)
docker stack deploy -c docker-compose.yml web2py-gunicorn-nginx
docker stack ls
docker stack ps web2py-gunicorn-nginx
docker stack services web2py-gunicorn-nginx
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > run.sh
EOF
cat run.sh
cat << EOF > w2p.conf
EOF
cat w2p.conf
cat << EOF > web2py-gunicorn
EOF
cat web2py-gunicorn
cat << EOF > web2py-nginx
EOF
cat web2py-nginx
chmod 755 run.sh
./run.sh
docker-compose up -d
docker-compose ps
+34
View File
@@ -0,0 +1,34 @@
version: '3.1'
services:
web2py-gunicorn:
build:
context: .
dockerfile: web2py-gunicorn
container_name: web2py-gunicorn
ports:
- "9005:9005"
networks:
web2py-net:
ipv4_address: 172.25.0.22
volumes:
- applications:/home/web2py/web2py/applications
web2py-nginx:
build:
context: .
dockerfile: web2py-nginx
container_name: web2py-nginx
networks:
web2py-net:
ipv4_address: 172.25.0.23
networks:
web2py-net:
driver: bridge
ipam:
config:
- subnet: 172.25.0.0/16
volumes:
applications:
+34
View File
@@ -0,0 +1,34 @@
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-gunicorn --format="{{.ID}}"))
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-nginx --format="{{.ID}}"))
docker network rm web2py-net
#docker network create web2py-net
docker network create --subnet=172.25.0.0/16 web2py-net
docker build -t web2py-gunicorn -f web2py-gunicorn .
docker build -t web2py-nginx -f web2py-nginx .
docker run -d --net web2py-net -v applications:/home/web2py/web2py/applications -p 9005:9005 --name web2py-gunicorn --ip 172.25.0.22 web2py-gunicorn
# docker exec -it web2py-gunicorn bash
sleep 2
ping -c1 -n 172.25.0.22
docker run --net web2py-net busybox ping -c1 -n web2py-gunicorn
echo "------------------------------------------------------------------"
curl -I 172.25.0.22:9005
docker run -d --net web2py-net --name web2py-nginx --ip 172.25.0.23 web2py-nginx
# docker exec -it web2py-nginx bash
sleep 2
ping -c1 -n 172.25.0.23
docker run --net web2py-net busybox ping -c1 -n web2py-nginx
echo "------------------------------------------------------------------"
curl -I 172.25.0.23
docker network ls
docker network inspect web2py-net
docker volume ls
docker volume inspect applications
docker ps -a
docker ps
@@ -0,0 +1,20 @@
upstream gunicorn {
#server 172.25.0.22:9005 fail_timeout=0;
server web2py-gunicorn:9005 fail_timeout=0;
}
server {
#listen 172.25.0.23:80 default_server;
listen web2py-nginx:80 default_server;
location / {
try_files $uri @proxy_to_gunicorn;
}
location @proxy_to_gunicorn {
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_set_header Host $host;
proxy_pass http://gunicorn;
}
}
@@ -0,0 +1,22 @@
FROM python:2.7
RUN apt update && apt install -y unzip wget
ENV PATH=/usr/local/bin:$PATH
RUN pip install gunicorn
RUN useradd -m -r web2py
USER web2py
WORKDIR /home/web2py
RUN wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -f web2py_src.zip
WORKDIR /home/web2py/web2py
RUN cp handlers/wsgihandler.py .
CMD /usr/local/bin/gunicorn --workers 4 --timeout=90 --graceful-timeout=10 --bind :9005 wsgihandler:application
@@ -0,0 +1,10 @@
FROM nginx:latest
COPY ./w2p.conf /etc/nginx/conf.d/
RUN apt update
RUN apt-get install curl -y
EXPOSE 80
CMD nginx -g "daemon off;"
+56
View File
@@ -0,0 +1,56 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/App/web2py-rocket-nginx
chmod 775 run.sh
./run.sh
# Docker Compose
pip install docker-compose
cd /Docker/App/web2py-rocket-nginx
docker-compose up -d
docker-compose ps
docker network ls
docker network inspect root_default
docker volume ls
docker volume inspect root_applications
# Docker Stack
docker swarm init --advertise-addr $(hostname -i)
docker stack deploy -c docker-compose.yml web2py-rocket-nginx
docker stack ls
docker stack ps web2py-rocket-nginx
docker stack services web2py-rocket-nginx
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > run.sh
EOF
cat run.sh
cat << EOF > w2p.conf
EOF
cat w2p.conf
cat << EOF > web2py-nginx
EOF
cat web2py-nginx
cat << EOF > web2py-rocket
EOF
cat web2py-rocket
chmod 755 run.sh
./run.sh
docker-compose up -d
docker-compose ps
+34
View File
@@ -0,0 +1,34 @@
version: '3.1'
services:
web2py-rocket:
build:
context: .
dockerfile: web2py-rocket
container_name: web2py-rocket
ports:
- "8000:8000"
networks:
web2py-net:
ipv4_address: 172.25.0.22
volumes:
- applications:/home/web2py/web2py/applications
web2py-nginx:
build:
context: .
dockerfile: web2py-nginx
container_name: web2py-nginx
networks:
web2py-net:
ipv4_address: 172.25.0.23
networks:
web2py-net:
driver: bridge
ipam:
config:
- subnet: 172.25.0.0/16
volumes:
applications:
+34
View File
@@ -0,0 +1,34 @@
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-rocket --format="{{.ID}}"))
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-nginx --format="{{.ID}}"))
docker network rm web2py-net
#docker network create web2py-net
docker network create --subnet=172.25.0.0/16 web2py-net
docker build -t web2py-rocket -f web2py-rocket .
docker build -t web2py-nginx -f web2py-nginx .
docker run -d --net web2py-net -v applications:/home/web2py/web2py/applications -p 8000:8000 --name web2py-rocket --ip 172.25.0.22 web2py-rocket
# docker exec -it web2py-rocket bash
sleep 2
ping -c1 -n 172.25.0.22
docker run --net web2py-net busybox ping -c1 -n web2py-rocket
echo "------------------------------------------------------------------"
curl -I 172.25.0.22:8000
docker run -d --net web2py-net --name web2py-nginx --ip 172.25.0.23 web2py-nginx
# docker exec -it web2py-nginx bash
sleep 2
ping -c1 -n 172.25.0.23
docker run --net web2py-net busybox ping -c1 -n web2py-nginx
echo "------------------------------------------------------------------"
curl -I 172.25.0.23
docker network ls
docker network inspect web2py-net
docker volume ls
docker volume inspect applications
docker ps -a
docker ps
+20
View File
@@ -0,0 +1,20 @@
upstream gunicorn {
#server 172.25.0.22:8000 fail_timeout=0;
server web2py-rocket:8000 fail_timeout=0;
}
server {
#listen 172.25.0.23:80 default_server;
listen web2py-nginx:80 default_server;
location / {
try_files $uri @proxy_to_gunicorn;
}
location @proxy_to_gunicorn {
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_set_header Host $host;
proxy_pass http://gunicorn;
}
}
@@ -0,0 +1,10 @@
FROM nginx:latest
COPY ./w2p.conf /etc/nginx/conf.d/
RUN apt update
RUN apt-get install curl -y
EXPOSE 80
CMD nginx -g "daemon off;"
@@ -0,0 +1,25 @@
FROM alpine:latest
RUN apk add --no-cache python py-pip py-setuptools unzip wget && \
pip install --upgrade pip && \
pip install virtualenv
RUN addgroup -S web2py && \
adduser -D -S -G web2py web2py
USER web2py
RUN virtualenv /home/web2py && \
rm -rf /home/web2py/web2py && \
cd /home/web2py/ && \
rm -f web2py_src.zip && \
wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /home/web2py/web2py/applications/examples && \
chmod 755 -R /home/web2py/web2py
WORKDIR /home/web2py/web2py
EXPOSE 8000
CMD . /home/web2py/bin/activate && python /home/web2py/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000
+66
View File
@@ -0,0 +1,66 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/App/web2py-rocket-ssl-nginx-db-adminer
chmod 775 run.sh
./run.sh
# Docker Compose
pip install docker-compose
cd /Docker/App/web2py-rocket-ssl-nginx-db-adminer
docker-compose up -d
docker-compose ps
docker network ls
docker network inspect root_default
docker volume ls
docker volume inspect root_applications
# Docker Stack
docker swarm init --advertise-addr $(hostname -i)
docker stack deploy -c docker-compose.yml web2py-rocket-ssl-nginx-db-adminer
docker stack ls
docker stack ps web2py-rocket-ssl-nginx-db-adminer
docker stack services web2py-rocket-ssl-nginx-db-adminer
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > run.sh
EOF
cat run.sh
cat << EOF > w2p.conf
EOF
cat w2p.conf
cat << EOF > web2py-adminer
EOF
cat web2py-adminer
cat << EOF > web2py-db
EOF
cat web2py-db
cat << EOF > web2py-nginx
EOF
cat web2py-nginx
cat << EOF > web2py-rocket-ssl
EOF
cat web2py-rocket-ssl
chmod 755 run.sh
./run.sh
docker-compose up -d
docker-compose ps
@@ -0,0 +1,54 @@
version: '3.1'
services:
web2py-rocket-ssl:
build:
context: .
dockerfile: web2py-rocket-ssl
container_name: web2py-rocket-ssl
ports:
- "443:443"
networks:
web2py-net:
ipv4_address: 172.25.0.22
volumes:
- applications:/home/web2py/web2py/applications
web2py-nginx:
build:
context: .
dockerfile: web2py-nginx
container_name: web2py-nginx
networks:
web2py-net:
ipv4_address: 172.25.0.23
web2py-db:
build:
context: .
dockerfile: web2py-db
container_name: web2py-db
networks:
web2py-net:
ipv4_address: 172.25.0.24
web2py-adminer:
build:
context: .
dockerfile: web2py-adminer
container_name: web2py-adminer
ports:
- "8080:8080"
networks:
web2py-net:
ipv4_address: 172.25.0.25
networks:
web2py-net:
driver: bridge
ipam:
config:
- subnet: 172.25.0.0/16
volumes:
applications:
+56
View File
@@ -0,0 +1,56 @@
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-rocket-ssl --format="{{.ID}}"))
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-nginx --format="{{.ID}}"))
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-db --format="{{.ID}}"))
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-adminer --format="{{.ID}}"))
docker network rm web2py-net
#docker network create web2py-net
docker network create --subnet=172.25.0.0/16 web2py-net
docker build -t web2py-rocket-ssl -f web2py-rocket-ssl .
docker build -t web2py-nginx -f web2py-nginx .
docker build -t web2py-db -f web2py-db .
docker build -t web2py-adminer -f web2py-adminer .
docker run -d --net web2py-net -v applications:/home/web2py/web2py/applications -p 443:443 --name web2py-rocket-ssl --ip 172.25.0.22 web2py-rocket-ssl
# docker exec -it web2py-rocket-ssl bash
sleep 2
ping -c1 -n 172.25.0.22
docker run --net web2py-net busybox ping -c1 -n web2py-rocket-ssl
echo "------------------------------------------------------------------"
curl -I 172.25.0.22:443
docker run -d --net web2py-net --name web2py-nginx --ip 172.25.0.23 web2py-nginx
# docker exec -it web2py-nginx bash
sleep 2
ping -c1 -n 172.25.0.23
docker run --net web2py-net busybox ping -c1 -n web2py-nginx
echo "------------------------------------------------------------------"
curl -I 172.25.0.23
docker run -d --net web2py-net --name web2py-db --ip 172.25.0.24 web2py-db
# docker exec -it web2py-db bash
sleep 2
ping -c1 -n 172.25.0.24
docker run --net web2py-net busybox ping -c1 -n web2py-db
echo "------------------------------------------------------------------"
curl -I 172.25.0.24
docker run -d --net web2py-net -p 8080:8080 --name web2py-adminer --ip 172.25.0.25 web2py-adminer
# docker exec -it web2py-adminer bash
sleep 2
ping -c1 -n 172.25.0.25
docker run --net web2py-net busybox ping -c1 -n web2py-adminer
echo "------------------------------------------------------------------"
curl -I 172.25.0.25
docker network ls
docker network inspect web2py-net
docker volume ls
docker volume inspect applications
docker ps -a
docker ps
@@ -0,0 +1,20 @@
upstream gunicorn {
#server 172.25.0.22:443 fail_timeout=0;
server web2py-rocket-ssl:443 fail_timeout=0;
}
server {
#listen 172.25.0.23:80 default_server;
listen web2py-nginx:80 default_server;
location / {
try_files $uri @proxy_to_gunicorn;
}
location @proxy_to_gunicorn {
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_set_header Host $host;
proxy_pass http://gunicorn;
}
}
@@ -0,0 +1,3 @@
FROM adminer:latest
EXPOSE 8080
@@ -0,0 +1,9 @@
#FROM mariadb:latest
#FROM mysql:latest
#FROM percona:latest
FROM postgres:latest
#FROM mongo:latest
#FROM couchdb:latest
ENV MYSQL_ROOT_PASSWORD=example \
POSTGRES_PASSWORD=example
@@ -0,0 +1,10 @@
FROM nginx:latest
COPY ./w2p.conf /etc/nginx/conf.d/
RUN apt update
RUN apt-get install curl -y
EXPOSE 80
CMD nginx -g "daemon off;"
@@ -0,0 +1,20 @@
FROM alpine:latest
RUN apk add --no-cache python py-pip py-setuptools unzip wget openssl && \
pip install --upgrade pip && \
pip install virtualenv CouchDB pg8000 pymongo PyMySQL
RUN wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /web2py/applications/examples && \
cd /web2py && \
openssl genrsa 1024 > web2py.key && chmod 400 web2py.key && \
openssl req -new -x509 -nodes -sha1 -days 1780 -subj '/C=c/ST=st/L=l/O=o/OU=ou/CN=cn.com' -key web2py.key > web2py.crt && \
openssl x509 -noout -fingerprint -text < web2py.crt > web2py.info && \
chmod 755 -R /web2py
WORKDIR /web2py
EXPOSE 443
CMD python /web2py/web2py.py --nogui --no-banner -a 'a' -c web2py.crt -k web2py.key -i 0.0.0.0 -p 443
+61
View File
@@ -0,0 +1,61 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/App/web2py-rocket-ssl-nginx-memcached
chmod 775 run.sh
./run.sh
# Docker Compose
pip install docker-compose
cd /Docker/App/web2py-rocket-ssl-nginx-memcached
docker-compose up -d
docker-compose ps
docker network ls
docker network inspect root_default
docker volume ls
docker volume inspect root_applications
# Docker Stack
docker swarm init --advertise-addr $(hostname -i)
docker stack deploy -c docker-compose.yml web2py-rocket-ssl-nginx-memcached
docker stack ls
docker stack ps web2py-rocket-ssl-nginx-memcached
docker stack services web2py-rocket-ssl-nginx-memcached
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > run.sh
EOF
cat run.sh
cat << EOF > w2p.conf
EOF
cat w2p.conf
cat << EOF > web2py-memcached
EOF
cat web2py-memcached
cat << EOF > web2py-nginx
EOF
cat web2py-nginx
cat << EOF > web2py-rocket-ssl
EOF
cat web2py-rocket-ssl
chmod 755 run.sh
./run.sh
docker-compose up -d
docker-compose ps
@@ -0,0 +1,43 @@
version: '3.1'
services:
web2py-rocket-ssl:
build:
context: .
dockerfile: web2py-rocket-ssl
container_name: web2py-rocket-ssl
ports:
- "443:443"
networks:
web2py-net:
ipv4_address: 172.25.0.22
volumes:
- applications:/home/web2py/web2py/applications
web2py-nginx:
build:
context: .
dockerfile: web2py-nginx
container_name: web2py-nginx
networks:
web2py-net:
ipv4_address: 172.25.0.23
web2py-memcached:
build:
context: .
dockerfile: web2py-memcached
container_name: web2py-memcached
networks:
web2py-net:
ipv4_address: 172.25.0.24
networks:
web2py-net:
driver: bridge
ipam:
config:
- subnet: 172.25.0.0/16
volumes:
applications:
+45
View File
@@ -0,0 +1,45 @@
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-rocket-ssl --format="{{.ID}}"))
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-nginx --format="{{.ID}}"))
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-memcached --format="{{.ID}}"))
docker network rm web2py-net
#docker network create web2py-net
docker network create --subnet=172.25.0.0/16 web2py-net
docker build -t web2py-rocket-ssl -f web2py-rocket-ssl .
docker build -t web2py-nginx -f web2py-nginx .
docker build -t web2py-memcached -f web2py-memcached .
docker run -d --net web2py-net -v applications:/home/web2py/web2py/applications -p 443:443 --name web2py-rocket-ssl --ip 172.25.0.22 web2py-rocket-ssl
# docker exec -it web2py-rocket-ssl bash
sleep 2
ping -c1 -n 172.25.0.22
docker run --net web2py-net busybox ping -c1 -n web2py-rocket-ssl
echo "------------------------------------------------------------------"
curl -I 172.25.0.22:443
docker run -d --net web2py-net --name web2py-nginx --ip 172.25.0.23 web2py-nginx
# docker exec -it web2py-nginx bash
sleep 2
ping -c1 -n 172.25.0.23
docker run --net web2py-net busybox ping -c1 -n web2py-nginx
echo "------------------------------------------------------------------"
curl -I 172.25.0.23
docker run -d --net web2py-net --name web2py-memcached --ip 172.25.0.24 web2py-memcached
# docker exec -it web2py-memcached bash
sleep 2
ping -c1 -n 172.25.0.24
docker run --net web2py-net busybox ping -c1 -n web2py-memcached
echo "------------------------------------------------------------------"
curl -I 172.25.0.24
docker network ls
docker network inspect web2py-net
docker volume ls
docker volume inspect applications
docker ps -a
docker ps
@@ -0,0 +1,20 @@
upstream gunicorn {
#server 172.25.0.22:443 fail_timeout=0;
server web2py-rocket-ssl:443 fail_timeout=0;
}
server {
#listen 172.25.0.23:80 default_server;
listen web2py-nginx:80 default_server;
location / {
try_files $uri @proxy_to_gunicorn;
}
location @proxy_to_gunicorn {
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_set_header Host $host;
proxy_pass http://gunicorn;
}
}
@@ -0,0 +1 @@
FROM memcached:latest
@@ -0,0 +1,10 @@
FROM nginx:latest
COPY ./w2p.conf /etc/nginx/conf.d/
RUN apt update
RUN apt-get install curl -y
EXPOSE 80
CMD nginx -g "daemon off;"
@@ -0,0 +1,20 @@
FROM alpine:latest
RUN apk add --no-cache python py-pip py-setuptools unzip wget openssl && \
pip install --upgrade pip && \
pip install virtualenv
RUN wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /web2py/applications/examples && \
cd /web2py && \
openssl genrsa 1024 > web2py.key && chmod 400 web2py.key && \
openssl req -new -x509 -nodes -sha1 -days 1780 -subj '/C=c/ST=st/L=l/O=o/OU=ou/CN=cn.com' -key web2py.key > web2py.crt && \
openssl x509 -noout -fingerprint -text < web2py.crt > web2py.info && \
chmod 755 -R /web2py
WORKDIR /web2py
EXPOSE 443
CMD python /web2py/web2py.py --nogui --no-banner -a 'a' -c web2py.crt -k web2py.key -i 0.0.0.0 -p 443
+61
View File
@@ -0,0 +1,61 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/App/web2py-rocket-ssl-nginx-redis
chmod 775 run.sh
./run.sh
# Docker Compose
pip install docker-compose
cd /Docker/App/web2py-rocket-ssl-nginx-redis
docker-compose up -d
docker-compose ps
docker network ls
docker network inspect root_default
docker volume ls
docker volume inspect root_applications
# Docker Stack
docker swarm init --advertise-addr $(hostname -i)
docker stack deploy -c docker-compose.yml web2py-rocket-ssl-nginx-redis
docker stack ls
docker stack ps web2py-rocket-ssl-nginx-redis
docker stack services web2py-rocket-ssl-nginx-redis
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > run.sh
EOF
cat run.sh
cat << EOF > w2p.conf
EOF
cat w2p.conf
cat << EOF > web2py-nginx
EOF
cat web2py-nginx
cat << EOF > web2py-redis
EOF
cat web2py-redis
cat << EOF > web2py-rocket-ssl
EOF
cat web2py-rocket-ssl
chmod 755 run.sh
./run.sh
docker-compose up -d
docker-compose ps
@@ -0,0 +1,43 @@
version: '3.1'
services:
web2py-rocket-ssl:
build:
context: .
dockerfile: web2py-rocket-ssl
container_name: web2py-rocket-ssl
ports:
- "443:443"
networks:
web2py-net:
ipv4_address: 172.25.0.22
volumes:
- applications:/home/web2py/web2py/applications
web2py-nginx:
build:
context: .
dockerfile: web2py-nginx
container_name: web2py-nginx
networks:
web2py-net:
ipv4_address: 172.25.0.23
web2py-redis:
build:
context: .
dockerfile: web2py-redis
container_name: web2py-redis
networks:
web2py-net:
ipv4_address: 172.25.0.24
networks:
web2py-net:
driver: bridge
ipam:
config:
- subnet: 172.25.0.0/16
volumes:
applications:
+45
View File
@@ -0,0 +1,45 @@
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-rocket-ssl --format="{{.ID}}"))
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-nginx --format="{{.ID}}"))
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-redis --format="{{.ID}}"))
docker network rm web2py-net
#docker network create web2py-net
docker network create --subnet=172.25.0.0/16 web2py-net
docker build -t web2py-rocket-ssl -f web2py-rocket-ssl .
docker build -t web2py-nginx -f web2py-nginx .
docker build -t web2py-redis -f web2py-redis .
docker run -d --net web2py-net -v applications:/home/web2py/web2py/applications -p 443:443 --name web2py-rocket-ssl --ip 172.25.0.22 web2py-rocket-ssl
# docker exec -it web2py-rocket-ssl bash
sleep 2
ping -c1 -n 172.25.0.22
docker run --net web2py-net busybox ping -c1 -n web2py-rocket-ssl
echo "------------------------------------------------------------------"
curl -I 172.25.0.22:443
docker run -d --net web2py-net --name web2py-nginx --ip 172.25.0.23 web2py-nginx
# docker exec -it web2py-nginx bash
sleep 2
ping -c1 -n 172.25.0.23
docker run --net web2py-net busybox ping -c1 -n web2py-nginx
echo "------------------------------------------------------------------"
curl -I 172.25.0.23
docker run -d --net web2py-net --name web2py-redis --ip 172.25.0.24 web2py-redis
# docker exec -it web2py-redis bash
sleep 2
ping -c1 -n 172.25.0.24
docker run --net web2py-net busybox ping -c1 -n web2py-redis
echo "------------------------------------------------------------------"
curl -I 172.25.0.24
docker network ls
docker network inspect web2py-net
docker volume ls
docker volume inspect applications
docker ps -a
docker ps
@@ -0,0 +1,20 @@
upstream gunicorn {
#server 172.25.0.22:443 fail_timeout=0;
server web2py-rocket-ssl:443 fail_timeout=0;
}
server {
#listen 172.25.0.23:80 default_server;
listen web2py-nginx:80 default_server;
location / {
try_files $uri @proxy_to_gunicorn;
}
location @proxy_to_gunicorn {
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_set_header Host $host;
proxy_pass http://gunicorn;
}
}
@@ -0,0 +1,10 @@
FROM nginx:latest
COPY ./w2p.conf /etc/nginx/conf.d/
RUN apt update
RUN apt-get install curl -y
EXPOSE 80
CMD nginx -g "daemon off;"
@@ -0,0 +1 @@
FROM redis:latest
@@ -0,0 +1,20 @@
FROM alpine:latest
RUN apk add --no-cache python py-pip py-setuptools unzip wget openssl && \
pip install --upgrade pip && \
pip install virtualenv redis
RUN wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /web2py/applications/examples && \
cd /web2py && \
openssl genrsa 1024 > web2py.key && chmod 400 web2py.key && \
openssl req -new -x509 -nodes -sha1 -days 1780 -subj '/C=c/ST=st/L=l/O=o/OU=ou/CN=cn.com' -key web2py.key > web2py.crt && \
openssl x509 -noout -fingerprint -text < web2py.crt > web2py.info && \
chmod 755 -R /web2py
WORKDIR /web2py
EXPOSE 443
CMD python /web2py/web2py.py --nogui --no-banner -a 'a' -c web2py.crt -k web2py.key -i 0.0.0.0 -p 443
+56
View File
@@ -0,0 +1,56 @@
# Start Service
systemctl start docker
# Docker
cd /Docker/App/web2py-rocket-ssl-nginx
chmod 775 run.sh
./run.sh
# Docker Compose
pip install docker-compose
cd /Docker/App/web2py-rocket-ssl-nginx
docker-compose up -d
docker-compose ps
docker network ls
docker network inspect root_default
docker volume ls
docker volume inspect root_applications
# Docker Stack
docker swarm init --advertise-addr $(hostname -i)
docker stack deploy -c docker-compose.yml web2py-rocket-ssl-nginx
docker stack ls
docker stack ps web2py-rocket-ssl-nginx
docker stack services web2py-rocket-ssl-nginx
# Shell (Copy the content of the file into this scaffolding shell and replace the variable text $ with \$ )
cat << EOF > docker-compose.yml
EOF
cat docker-compose.yml
cat << EOF > run.sh
EOF
cat run.sh
cat << EOF > w2p.conf
EOF
cat w2p.conf
cat << EOF > web2py-nginx
EOF
cat web2py-nginx
cat << EOF > web2py-rocket-ssl
EOF
cat web2py-rocket-ssl
chmod 755 run.sh
./run.sh
docker-compose up -d
docker-compose ps
+34
View File
@@ -0,0 +1,34 @@
version: '3.1'
services:
web2py-rocket-ssl:
build:
context: .
dockerfile: web2py-rocket-ssl
container_name: web2py-rocket-ssl
ports:
- "443:443"
networks:
web2py-net:
ipv4_address: 172.25.0.22
volumes:
- applications:/home/web2py/web2py/applications
web2py-nginx:
build:
context: .
dockerfile: web2py-nginx
container_name: web2py-nginx
networks:
web2py-net:
ipv4_address: 172.25.0.23
networks:
web2py-net:
driver: bridge
ipam:
config:
- subnet: 172.25.0.0/16
volumes:
applications:
+34
View File
@@ -0,0 +1,34 @@
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-rocket-ssl --format="{{.ID}}"))
docker rm $(docker stop $(docker ps -a -q --filter ancestor=web2py-nginx --format="{{.ID}}"))
docker network rm web2py-net
#docker network create web2py-net
docker network create --subnet=172.25.0.0/16 web2py-net
docker build -t web2py-rocket-ssl -f web2py-rocket-ssl .
docker build -t web2py-nginx -f web2py-nginx .
docker run -d --net web2py-net -v applications:/home/web2py/web2py/applications -p 443:443 --name web2py-rocket-ssl --ip 172.25.0.22 web2py-rocket-ssl
# docker exec -it web2py-rocket-ssl bash
sleep 2
ping -c1 -n 172.25.0.22
docker run --net web2py-net busybox ping -c1 -n web2py-rocket-ssl
echo "------------------------------------------------------------------"
curl -I 172.25.0.22:443
docker run -d --net web2py-net --name web2py-nginx --ip 172.25.0.23 web2py-nginx
# docker exec -it web2py-nginx bash
sleep 2
ping -c1 -n 172.25.0.23
docker run --net web2py-net busybox ping -c1 -n web2py-nginx
echo "------------------------------------------------------------------"
curl -I 172.25.0.23
docker network ls
docker network inspect web2py-net
docker volume ls
docker volume inspect applications
docker ps -a
docker ps
@@ -0,0 +1,20 @@
upstream gunicorn {
#server 172.25.0.22:443 fail_timeout=0;
server web2py-rocket-ssl:443 fail_timeout=0;
}
server {
#listen 172.25.0.23:80 default_server;
listen web2py-nginx:80 default_server;
location / {
try_files \$uri @proxy_to_gunicorn;
}
location @proxy_to_gunicorn {
proxy_set_header X-Real-IP \$remote_addr;
proxy_redirect off;
proxy_set_header Host \$host;
proxy_pass http://gunicorn;
}
}
@@ -0,0 +1,10 @@
FROM nginx:latest
COPY ./w2p.conf /etc/nginx/conf.d/
RUN apt update
RUN apt-get install curl -y
EXPOSE 80
CMD nginx -g "daemon off;"
@@ -0,0 +1,20 @@
FROM alpine:latest
RUN apk add --no-cache python py-pip py-setuptools unzip wget openssl && \
pip install --upgrade pip && \
pip install virtualenv
RUN wget -c http://web2py.com/examples/static/web2py_src.zip && \
unzip -o web2py_src.zip && \
rm -rf /web2py/applications/examples && \
cd /web2py && \
openssl genrsa 1024 > web2py.key && chmod 400 web2py.key && \
openssl req -new -x509 -nodes -sha1 -days 1780 -subj '/C=c/ST=st/L=l/O=o/OU=ou/CN=cn.com' -key web2py.key > web2py.crt && \
openssl x509 -noout -fingerprint -text < web2py.crt > web2py.info && \
chmod 755 -R /web2py
WORKDIR /web2py
EXPOSE 443
CMD python /web2py/web2py.py --nogui --no-banner -a 'a' -c web2py.crt -k web2py.key -i 0.0.0.0 -p 443

Some files were not shown because too many files have changed in this diff Show More