├── 1 ├── redis │ └── 123 ├── hello │ ├── hello.py │ └── long.py ├── Dockerfiles │ ├── Dockerfile_nginx_0 │ ├── Dockerfile │ ├── Dockerfile_long │ └── Dockerfile_nginx └── nginx │ ├── Dockerfile │ ├── custom.conf │ └── index.html └── 2 ├── size ├── .dockerignore ├── custom.conf └── app │ └── index.html ├── compose ├── www │ ├── phpinfo │ │ └── index.php │ └── index.html ├── php │ ├── www │ │ ├── phpinfo │ │ │ └── index.php │ │ └── index.html │ └── Dockerfile ├── nginx │ ├── www │ │ ├── phpinfo │ │ │ └── index.php │ │ └── index.html │ ├── Dockerfile │ └── custom.conf ├── docker-compose.test.yml ├── test │ ├── Dockerfile │ └── docker-entrypoint.sh ├── docker-compose.production.yml └── docker-compose.yml └── Dockerfiles ├── Dockerfile └── Dockerfile_ideal /1/redis/123: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /1/hello/hello.py: -------------------------------------------------------------------------------- 1 | print("It's work!") 2 | -------------------------------------------------------------------------------- /2/size/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | Dockerfile 3 | -------------------------------------------------------------------------------- /2/compose/www/phpinfo/index.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /2/compose/php/www/phpinfo/index.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /2/compose/nginx/www/phpinfo/index.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /1/hello/long.py: -------------------------------------------------------------------------------- 1 | import time 2 | import datetime 3 | 4 | while True: 5 | print (str(datetime.datetime.now())) 6 | time.sleep (2) 7 | -------------------------------------------------------------------------------- /1/Dockerfiles/Dockerfile_nginx_0: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | 3 | COPY index.html /usr/share/nginx/html 4 | 5 | EXPOSE 80 6 | 7 | CMD ["nginx", "-g", "daemon off;"] 8 | -------------------------------------------------------------------------------- /2/compose/docker-compose.test.yml: -------------------------------------------------------------------------------- 1 | version: "2.3" 2 | services: 3 | test: 4 | build: ./test 5 | depends_on: 6 | - php 7 | - nginx 8 | -------------------------------------------------------------------------------- /2/compose/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-fpm 2 | 3 | EXPOSE 9000 4 | 5 | WORKDIR /var/www 6 | 7 | COPY ./www/ /var/www/ 8 | 9 | CMD ["php-fpm"] 10 | -------------------------------------------------------------------------------- /1/Dockerfiles/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.6 2 | 3 | RUN mkdir /opt/app 4 | WORKDIR /opt/app 5 | 6 | COPY hello.py /opt/app 7 | 8 | CMD ["python", "hello.py"] 9 | -------------------------------------------------------------------------------- /1/Dockerfiles/Dockerfile_long: -------------------------------------------------------------------------------- 1 | FROM python:3.6 2 | 3 | RUN mkdir /opt/app 4 | WORKDIR /opt/app 5 | 6 | COPY long.py /opt/app 7 | 8 | CMD ["python", "long.py"] 9 | -------------------------------------------------------------------------------- /2/compose/test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.11.5 2 | 3 | RUN apk add --no-cache curl 4 | 5 | COPY docker-entrypoint.sh / 6 | 7 | ENTRYPOINT ["/docker-entrypoint.sh"] 8 | -------------------------------------------------------------------------------- /1/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | 3 | COPY index.html /usr/share/nginx/html 4 | ADD custom.conf /etc/nginx/conf.d/ 5 | 6 | EXPOSE 80 7 | 8 | ENV FOO bar 9 | 10 | CMD ["nginx", "-g", "daemon off;"] 11 | -------------------------------------------------------------------------------- /1/Dockerfiles/Dockerfile_nginx: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | 3 | COPY index.html /usr/share/nginx/html 4 | ADD custom.conf /etc/nginx/conf.d/ 5 | 6 | EXPOSE 80 7 | 8 | ENV FOO bar 9 | 10 | CMD ["nginx", "-g", "daemon off;"] 11 | -------------------------------------------------------------------------------- /2/Dockerfiles/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian 2 | 3 | COPY . /opt/ 4 | 5 | RUN apt-get update 6 | RUN apt-get install -y nginx 7 | 8 | COPY custom.conf /etc/nginx/conf.d/ 9 | 10 | EXPOSE 80 11 | 12 | CMD ["nginx", "-g", "daemon off;"] 13 | -------------------------------------------------------------------------------- /2/compose/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.11.5 2 | 3 | RUN apk add --no-cache nginx && mkdir -p /run/nginx 4 | 5 | EXPOSE 80 6 | 7 | COPY custom.conf /etc/nginx/conf.d/ 8 | 9 | COPY ./www/ /var/www/ 10 | 11 | CMD ["nginx", "-g", "daemon off;"] 12 | -------------------------------------------------------------------------------- /2/Dockerfiles/Dockerfile_ideal: -------------------------------------------------------------------------------- 1 | FROM alpine:3.11.5 2 | 3 | ENV NGINX_VERSION 1.16 4 | 5 | RUN apk add --no-cache nginx-${NGINX_VERSION} && mkdir -p /run/nginx 6 | 7 | EXPOSE 80 8 | 9 | COPY custom.conf /etc/nginx/conf.d/ 10 | COPY . /opt/ 11 | 12 | CMD ["nginx", "-g", "daemon off;"] 13 | -------------------------------------------------------------------------------- /2/size/custom.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name docker.marsel.host; 4 | 5 | location / { 6 | root /opt/app; 7 | index index.html index.htm; 8 | } 9 | 10 | location /test { 11 | return 200 '$hostname\n'; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /1/nginx/custom.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name docker.marsel.host; 4 | 5 | location / { 6 | root /usr/share/nginx/html; 7 | index index.html index.htm; 8 | } 9 | 10 | location /test { 11 | return 200 '$hostname\n'; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /1/nginx/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |