From 6178e1198b89d37c0078834b94d1d1cd87aa48f4 Mon Sep 17 00:00:00 2001 From: saroff Date: Mon, 30 Mar 2020 23:54:35 +0300 Subject: [PATCH] Initial commit --- 2019-11/spring-31/classwork1/solution.txt | 8 ++ 2019-11/spring-31/classwork2/index.html | 1 + .../spring-31/classwork2/solution/Dockerfile | 4 + .../classwork2/solution/solution.txt | 11 +++ 2019-11/spring-31/classwork3/Dockerfile | 4 + 2019-11/spring-31/classwork3/index.html | 1 + .../classwork3/solution/commands.txt | 1 + .../classwork3/solution/docker-compose.yml | 10 ++ .../spring-31/database-example/commands.txt | 1 + .../docker-compose-example/commands.txt | 1 + .../docker-compose-example/docker-compose.yml | 27 ++++++ 2019-11/spring-31/stacks-example/commands.txt | 4 + .../stacks-example/docker-compose.yml | 93 +++++++++++++++++++ 13 files changed, 166 insertions(+) create mode 100644 2019-11/spring-31/classwork1/solution.txt create mode 100644 2019-11/spring-31/classwork2/index.html create mode 100644 2019-11/spring-31/classwork2/solution/Dockerfile create mode 100644 2019-11/spring-31/classwork2/solution/solution.txt create mode 100644 2019-11/spring-31/classwork3/Dockerfile create mode 100644 2019-11/spring-31/classwork3/index.html create mode 100644 2019-11/spring-31/classwork3/solution/commands.txt create mode 100644 2019-11/spring-31/classwork3/solution/docker-compose.yml create mode 100644 2019-11/spring-31/database-example/commands.txt create mode 100644 2019-11/spring-31/docker-compose-example/commands.txt create mode 100644 2019-11/spring-31/docker-compose-example/docker-compose.yml create mode 100644 2019-11/spring-31/stacks-example/commands.txt create mode 100644 2019-11/spring-31/stacks-example/docker-compose.yml diff --git a/2019-11/spring-31/classwork1/solution.txt b/2019-11/spring-31/classwork1/solution.txt new file mode 100644 index 00000000..d48e28e0 --- /dev/null +++ b/2019-11/spring-31/classwork1/solution.txt @@ -0,0 +1,8 @@ +docker image ls +docker pull hello-world +docker image ls +docker image rm hello-world +docker ps +docker run hello-world +docker ps +docker run -d hello-world diff --git a/2019-11/spring-31/classwork2/index.html b/2019-11/spring-31/classwork2/index.html new file mode 100644 index 00000000..f3e333e8 --- /dev/null +++ b/2019-11/spring-31/classwork2/index.html @@ -0,0 +1 @@ +

Hello World

diff --git a/2019-11/spring-31/classwork2/solution/Dockerfile b/2019-11/spring-31/classwork2/solution/Dockerfile new file mode 100644 index 00000000..68106c84 --- /dev/null +++ b/2019-11/spring-31/classwork2/solution/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:1.11-alpine +COPY ../index.html /usr/share/nginx/html/index.html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/2019-11/spring-31/classwork2/solution/solution.txt b/2019-11/spring-31/classwork2/solution/solution.txt new file mode 100644 index 00000000..972f490b --- /dev/null +++ b/2019-11/spring-31/classwork2/solution/solution.txt @@ -0,0 +1,11 @@ +docker build -t my-nginx-image:latest . +docker image ls +docker run my-nginx-image:latest +docker ps +docker run -d -p 80:80 my-nginx-image:latest +docker run -d -p 81:80 my-nginx-image:latest +docker ps +docker rm ..... +docker stop .... +docker rm .... +docker rm -f .... diff --git a/2019-11/spring-31/classwork3/Dockerfile b/2019-11/spring-31/classwork3/Dockerfile new file mode 100644 index 00000000..c51e4bde --- /dev/null +++ b/2019-11/spring-31/classwork3/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:1.11-alpine +COPY index.html /usr/share/nginx/html/index.html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/2019-11/spring-31/classwork3/index.html b/2019-11/spring-31/classwork3/index.html new file mode 100644 index 00000000..f3e333e8 --- /dev/null +++ b/2019-11/spring-31/classwork3/index.html @@ -0,0 +1 @@ +

Hello World

diff --git a/2019-11/spring-31/classwork3/solution/commands.txt b/2019-11/spring-31/classwork3/solution/commands.txt new file mode 100644 index 00000000..83ed0d06 --- /dev/null +++ b/2019-11/spring-31/classwork3/solution/commands.txt @@ -0,0 +1 @@ +docker-compose up diff --git a/2019-11/spring-31/classwork3/solution/docker-compose.yml b/2019-11/spring-31/classwork3/solution/docker-compose.yml new file mode 100644 index 00000000..56b3cae5 --- /dev/null +++ b/2019-11/spring-31/classwork3/solution/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3' +services: + one: + build: .. + ports: + - "80:80" + two: + image: "my-nginx-image" + ports: + - "81:80" diff --git a/2019-11/spring-31/database-example/commands.txt b/2019-11/spring-31/database-example/commands.txt new file mode 100644 index 00000000..45c57d25 --- /dev/null +++ b/2019-11/spring-31/database-example/commands.txt @@ -0,0 +1 @@ +docker run --detach --name=test-mysql --env="MYSQL_ROOT_PASSWORD=mypassword" --publish 6603:3306 mysql diff --git a/2019-11/spring-31/docker-compose-example/commands.txt b/2019-11/spring-31/docker-compose-example/commands.txt new file mode 100644 index 00000000..83ed0d06 --- /dev/null +++ b/2019-11/spring-31/docker-compose-example/commands.txt @@ -0,0 +1 @@ +docker-compose up diff --git a/2019-11/spring-31/docker-compose-example/docker-compose.yml b/2019-11/spring-31/docker-compose-example/docker-compose.yml new file mode 100644 index 00000000..6439fd46 --- /dev/null +++ b/2019-11/spring-31/docker-compose-example/docker-compose.yml @@ -0,0 +1,27 @@ +version: '2' +services: + dockerhost: + image: qoomon/docker-host + cap_add: [ 'NET_ADMIN', 'NET_RAW' ] + mem_limit: 4M + restart: on-failure + camunda: + image: camunda/camunda-bpm-platform:latest + ports: + - 8181:8080 + environment: + - DB_DRIVER=org.postgresql.Driver + - DB_URL=jdbc:postgresql://postgres:5432/process-engine + - DB_USERNAME=camunda + - DB_PASSWORD=camunda + - WAIT_FOR=postgres:5432 + postgres: + image: postgres:latest + environment: + - POSTGRES_USER=camunda + - POSTGRES_PASSWORD=camunda + - POSTGRES_DB=process-engine + volumes: + - my_dbdata:/var/lib/postgresql/data +volumes: + my_dbdata: diff --git a/2019-11/spring-31/stacks-example/commands.txt b/2019-11/spring-31/stacks-example/commands.txt new file mode 100644 index 00000000..7fea8c32 --- /dev/null +++ b/2019-11/spring-31/stacks-example/commands.txt @@ -0,0 +1,4 @@ +docker stack deploy -c docker-compose.yml 123 +docker stack ls +docker stack ps ..... +docker stack services .... diff --git a/2019-11/spring-31/stacks-example/docker-compose.yml b/2019-11/spring-31/stacks-example/docker-compose.yml new file mode 100644 index 00000000..e80f8c28 --- /dev/null +++ b/2019-11/spring-31/stacks-example/docker-compose.yml @@ -0,0 +1,93 @@ +version: "3" +services: + + redis: + image: redis:alpine + networks: + - frontend + deploy: + replicas: 1 + update_config: + parallelism: 2 + delay: 10s + restart_policy: + condition: on-failure + db: + image: postgres:9.4 + environment: + POSTGRES_USER: "postgres" + POSTGRES_PASSWORD: "postgres" + volumes: + - db-data:/var/lib/postgresql/data + networks: + - backend + deploy: + placement: + constraints: [node.role == manager] + vote: + image: dockersamples/examplevotingapp_vote:before + ports: + - 5000:80 + networks: + - frontend + depends_on: + - redis + deploy: + replicas: 2 + update_config: + parallelism: 2 + restart_policy: + condition: on-failure + result: + image: dockersamples/examplevotingapp_result:before + ports: + - 5001:80 + networks: + - backend + depends_on: + - db + deploy: + replicas: 1 + update_config: + parallelism: 2 + delay: 10s + restart_policy: + condition: on-failure + + worker: + image: dockersamples/examplevotingapp_worker + networks: + - frontend + - backend + depends_on: + - db + - redis + deploy: + mode: replicated + replicas: 1 + labels: [APP=VOTING] + restart_policy: + condition: on-failure + delay: 10s + max_attempts: 3 + window: 120s + placement: + constraints: [node.role == manager] + + visualizer: + image: dockersamples/visualizer:stable + ports: + - "8080:8080" + stop_grace_period: 1m30s + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + deploy: + placement: + constraints: [node.role == manager] + +networks: + frontend: + backend: + +volumes: + db-data: