Skip to content
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
12 changes: 10 additions & 2 deletions lesson_7_exercises/ex1.dkc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
sevices:
your_service:
version: "1"

services:
db:
image: ngx
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a miña recomendación e dar nomes que diga o que fan de maneira funcional, no o que son:
nginx >> proxy/frontend
java >> backend, service_x
mariadb >> operational_db, user_db, datalake

ports:
- "8011:80"
- "80:8888"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moito coidado cos portos mais habituais (80, 8000, 8080), son fonte de erros que se non te das conta, costa atopar o conflicto

volumes:
- "./config/ex1.conf:/etc/nginx/nginx.conf "
- "./view/ex1_web.html:/var/www/index.html"
2 changes: 1 addition & 1 deletion lesson_7_exercises/ex1.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker-compose ...
docker-compose --project-directory docker_course/lesson07/ex01/ up -d
12 changes: 12 additions & 0 deletions lesson_7_exercises/ex2.dkc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "1"

services:
db:
image: "mariadb:10.9.4"
container_name: mdb
env_file: "db.env"
adminer:
image: adminer
restart: always
ports:
- 8080:8080
20 changes: 19 additions & 1 deletion lesson_7_exercises/ex2.sh
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
docker-compose ...

$ docker-compose --project-directory docker_course/lesson07/ex02/ up -d
$ docker exec -it mdb bash

# mysql -u root -pXleA*00 --host 0.0.0.0 --port 3306
MariaDB [(none)]> SHOW DATABASES;
MariaDB [(none)]> SELECT host, user FROM mysql.user;
MariaDB [(none)]> SHOW GRANTS FOR 'alex'@'%';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'alex'@'%';
MariaDB [(none)]> QUIT;

# mysql -u alex -palex --host 0.0.0.0 --port 3306
MariaDB [(none)]> CREATE DATABASE lesson7;
MariaDB [(none)]> QUIT;

# mysql -u root -pXleA*00 --host 0.0.0.0 --port 3306
MariaDB [(none)]> SHOW DATABASES # ok;
MariaDB [(none)]> QUIT
# exit