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

Feat/william yataco #6

Open
wants to merge 17 commits into
base: master
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ node_modules/
DS_STORE
.DS_STORE

.vagrant
.vagrant

#dependecies
CLASE-05/challenge/05/project/**
13 changes: 13 additions & 0 deletions CLASE-04/Challenge/01/01challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Download mysql
docker pull mysql:5.7
# Download phpmyadmin
docker pull phpmyadmin:apache
# Run Mysql
docker run --name=challenge01-db -p 3306:3306 -e MYSQL_ROOT_PASSWORD=challenge01 -d mysql:5.7
# Run PhpMyAdmin
docker run --name=challenge01-phpmyadmin -p 8082:80 --link challenge01-db:db -d phpmyadmin:apache
docker stop challenge01-phpmyadmin
docker rm challenge01-phpmyadmin
docker stop challenge01-db
docker rm challenge01-db
10 changes: 10 additions & 0 deletions CLASE-04/Challenge/01/1-nginx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# Download nginx
docker pull nginx:1.22.1
# Run nginx
mkdir html
cd html
cat > index.html << EOF
<html><body>Challenge 01</body></html>
EOF
docker run --name challenge01 -v /root/html:/usr/share/nginx/html:ro -d -p 8080:80 nginx:1.22.1
Binary file added CLASE-04/Challenge/01/docker-playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CLASE-04/Challenge/01/phpmyadmin-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions CLASE-04/Challenge/02/02challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Download mongodb
docker pull mongo:4.2.24
# Download python
docker pull python:3.7.16-alpine
# Run mongodb
docker run -d -p 27017:27017 --name challenge02-db mongo:4.2.24
# Run python
pip install pymongo
python populate.py
python find.py
docker stop mongo:4.2.24
docker rm mongo:4.2.24
Binary file added CLASE-04/Challenge/02/challenge02-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions CLASE-04/Challenge/03/03challenge.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@ECHO OFF
:: Download nginx
docker pull nginx:1.22.1
:: Run nginx
docker run --name challenge03 -v %cd%/web:/usr/share/nginx/html:ro -d -p 9999:80 nginx:1.22.1
docker exec challenge03 ls /usr/share/nginx/html
docker stop challenge03
docker rm challenge03
8 changes: 8 additions & 0 deletions CLASE-04/Challenge/03/03challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# Download nginx
docker pull nginx:1.22.1
# Run nginx
docker run --name challenge03 -v /$(pwd)/web:/usr/share/nginx/html:ro -d -p 9999:80 nginx:1.22.1
docker exec challenge03 ls /usr/share/nginx/html
docker stop challenge03
docker rm challenge03
Binary file added CLASE-04/Challenge/03/challenge03-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CLASE-04/Challenge/03/challenge03-nginx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions CLASE-04/Challenge/04/04challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Build Dockerfile
docker build . -t challenge04-apache:new
# Run Dockerfile
docker run -d --name challenge04 -p 5050:80 challenge04-apache:new
# Inspect Image
echo Inspect image
docker inspect challenge04-apache:new
echo History image
docker history challenge04-apache:new
echo Inspect image layers
docker image inspect challenge04-apache:new -f '{{.RootFS.Layers}}'
docker stop challenge04
docker rm challenge04
9 changes: 9 additions & 0 deletions CLASE-04/Challenge/04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM nginx:alpine

LABEL project="challenge04"

#Como metadato, indicamos que el contenedor utiliza el puerto 80
EXPOSE 80

#Modificaciones sobre la imagen que he utilizado como base, en este caso alpine
COPY content/ /usr/share/nginx/html/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions CLASE-04/Challenge/05/05challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Image in My Docker Hub
# wyataco/challenge05-app:1.0
# wyataco/challenge05-consumer:1.0

# Run docker compose
docker-compose up -d
sleep 3
curl localhost:8000
sleep 2
docker logs service-consumer
sleep 3
docker-compose down
Binary file added CLASE-04/Challenge/05/challenge05-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions CLASE-04/Challenge/05/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3.8'

services:
challenge05-app:
image: wyataco/challenge05-app:1.0
container_name: service-flask-app
ports:
- 8000:8000
networks:
- challenge05

challenge05-consumer:
image: wyataco/challenge05-consumer:1.0
container_name: service-consumer
environment:
- LOCAL=true
- PYTHONUNBUFFERED=1
networks:
- challenge05

networks:
challenge05:
9 changes: 9 additions & 0 deletions CLASE-04/Challenge/05/src/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.10.11-alpine
WORKDIR /app
COPY requirements.txt requirements.txt

RUN pip install --no-cache-dir --requirement requirements.txt
COPY . /app
EXPOSE 8000

CMD [ "python", "app.py" ]
1 change: 1 addition & 0 deletions CLASE-04/Challenge/05/src/app/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Flask==2.0.3
8 changes: 8 additions & 0 deletions CLASE-04/Challenge/05/src/consumer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.10.11-alpine
WORKDIR /consumer
COPY requirements.txt requirements.txt

RUN pip install --no-cache-dir --requirement requirements.txt
COPY . /consumer

CMD [ "python", "consumer.py" ]
1 change: 1 addition & 0 deletions CLASE-04/Challenge/05/src/consumer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requests==2.22.0
14 changes: 14 additions & 0 deletions CLASE-04/Challenge/06/06challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Build Dockerfile
docker build -t wyataco/challenge06-pokepy:1.0 .
# Run Dockerfile
docker run -d --name challenge06 -p 5000:5000 wyataco/challenge06-pokepy:1.0
sleep 2
curl http://localhost:5000
sleep 3
curl http://localhost:5000
sleep 3
docker stop challenge06
docker rm challenge06
# Image in My Docker Hub
# wyataco/challenge06-pokepy:1.0
8 changes: 8 additions & 0 deletions CLASE-04/Challenge/06/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.10.11-alpine
WORKDIR /app
COPY requirements.txt requirements.txt

RUN pip install --no-cache-dir --requirement requirements.txt
COPY . /app

CMD [ "python", "app.py" ]
9 changes: 9 additions & 0 deletions CLASE-04/Challenge/07/07challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# Image in My Docker Hub
# wyataco/challenge07-backend-pokemon-app:1.0
# wyataco/challenge07-frontend-pokemon-app:1.0

# Run docker compose
docker-compose up -d
sleep 30
docker-compose down
9 changes: 9 additions & 0 deletions CLASE-04/Challenge/07/backend-pokemon-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.10.11-alpine
WORKDIR /app
COPY requirements.txt requirements.txt

RUN pip install --no-cache-dir --requirement requirements.txt
COPY . /app
EXPOSE 8000

CMD [ "python", "main.py" ]
26 changes: 26 additions & 0 deletions CLASE-04/Challenge/07/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.8'

services:
challenge07-backend:
image: wyataco/challenge07-backend-pokemon-app:1.0
container_name: backend-pokemon-app
environment:
- PORT=8500
ports:
- 8000:8500
networks:
- challenge07

challenge07-front:
image: wyataco/challenge07-frontend-pokemon-app:1.0
container_name: frontend-pokemon-app
environment:
- REACT_APP_URL_DEVELOPMENT=http://localhost:8000
ports:
- 3000:3000
networks:
- challenge07

networks:
challenge07:
driver: bridge
10 changes: 10 additions & 0 deletions CLASE-04/Challenge/07/frontend-pokemon-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:16-alpine
WORKDIR /usr/src/app
COPY package*.json ./

RUN npm install

COPY . /usr/src/app
EXPOSE 3000

CMD [ "npm", "start" ]
14 changes: 14 additions & 0 deletions CLASE-04/Challenge/08/08challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Image in My Docker Hub
# wyataco/challenge08-app:1.0

# Run docker compose
docker-compose up -d
sleep 5
curl http://localhost:8080
curl http://localhost:8080
curl http://localhost:8080
curl http://localhost:8080
curl http://localhost:8080
sleep 5
docker-compose down
9 changes: 9 additions & 0 deletions CLASE-04/Challenge/08/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.10.11-alpine
WORKDIR /app
COPY requirements.txt requirements.txt

RUN pip install --no-cache-dir --requirement requirements.txt
COPY . /app


CMD [ "python", "app.py" ]
26 changes: 26 additions & 0 deletions CLASE-04/Challenge/08/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.8'

services:
challenge08-app:
build: ./
container_name: challenge08-app
restart: always
ports:
- 8080:80
depends_on:
- challenge08-redis
networks:
- challenge08

challenge08-redis:
image: redis-alpine
container_name: redis
restart: always
ports:
- 6379:6379
networks:
- challenge08

networks:
challenge08:
driver: bridge
6 changes: 6 additions & 0 deletions CLASE-04/Challenge/09/09challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
git clone https://github.com/wodby/docker4drupal.git
cd docker4drupal
docker4drupal$ docker-compose up -d
sleep 30
docker ps
4 changes: 4 additions & 0 deletions CLASE-04/Challenge/10/10challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
docker-compose up -d --build
sleep 120
docker-compose down -v --rmi all
Binary file added CLASE-04/Challenge/10/challenge10-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions CLASE-04/Challenge/10/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: '3.8'

services:

db:
image: postgres:12
container_name: challenge10-postgres
restart: always
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: secret123
POSTGRES_DB: challenge10_database
PGDATA: /data/postgres
volumes:
- vol_postgres:/data/postgres
ports:
- "5432:5432"
networks:
- challenge10

pgadmin:
image: dpage/pgadmin4
container_name: challenge10-pgadmin
restart: always
ports:
- "8080:80"
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: secret123
volumes:
- vol_pgadmin:/var/lib/pgadmin
networks:
- challenge10

volumes:
vol_postgres:
vol_pgadmin:

networks:
challenge10:
driver: bridge
10 changes: 10 additions & 0 deletions CLASE-04/Challenge/11/11challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
mkdir lamp-app-ecommerce
cp -r ../../../CLASE-02/lamp-app-ecommerce/* lamp-app-ecommerce
docker compose up -d
sleep 30
docker ps
docker exec -t challenge11-php bash -c "sed -i 's/172.20.1.101/mariadb/g' /var/www/html/index.php"
sleep 30
docker-compose down -v --rmi all
rm -r lamp-app-ecommerce
4 changes: 4 additions & 0 deletions CLASE-04/Challenge/11/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM php:8-fpm

RUN apt-get update && \
docker-php-ext-install mysqli pdo pdo_mysql
Binary file added CLASE-04/Challenge/11/challenge11-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CLASE-04/Challenge/11/challenge11-web-error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CLASE-04/Challenge/11/challenge11-web-ok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading