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

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

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

View File

@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-gunicorn:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:

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

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

View File

@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-rocket-ssl:
build: .
ports:
- "443:443"
volumes:
- applications:/web2py/applications
volumes:
applications:

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

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

View File

@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-rocket:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications:

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

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

View File

@@ -0,0 +1,12 @@
version: '3.1'
services:
web2py-tornado:
build: .
ports:
- "8000:8000"
volumes:
- applications:/home/web2py/web2py/applications
volumes:
applications: