cs131014
5 years ago
1 changed files with 15 additions and 197 deletions
@ -1,198 +1,16 @@ |
|||||
= README |
= Our Team (R) |
||||
|
:nofooter: |
||||
Για να συνδεθούμε στην εικονική μηχανή τρέχουμε την εντολή. |
|
||||
|
|
||||
[source, console] |
|
||||
---- |
|
||||
ssh user@<ip> |
|
||||
password: **** |
|
||||
---- |
|
||||
|
|
||||
image::https://i.imgur.com/P4ViujF.png[] |
|
||||
|
|
||||
[CAUTION] |
|
||||
Πρέπει να είστε συνδεδεμένοι στο https://wiki.noc.uniwa.gr/doku.php?id=vpn_service_openvpn[VPN - Πανεπιστημίου Δυτικής Αττικής] |
|
||||
|
|
||||
== Τεχνολογίες |
|
||||
|
|
||||
Για την υλοποίηση της εργασίας χρησιμοποιήθηκε η τεχνολογία *Docker* το οποίο εικονικοποιεί σε επίπεδο λειτουργικού συστήματος. |
|
||||
|
|
||||
[source, console] |
|
||||
---- |
|
||||
sudo apt-get update |
|
||||
sudo apt install docker.io |
|
||||
sudo systemctl start docker |
|
||||
sudo systemctl enable docker |
|
||||
---- |
|
||||
|
|
||||
[TIP] |
|
||||
Για να ελέγξουμε ότι η υπηρεσία του *Docker* λειτουργεί εκτελούμε την εντολή |
|
||||
|
|
||||
[source, console] |
|
||||
---- |
|
||||
docker --version |
|
||||
---- |
|
||||
|
|
||||
== Εκτέλεση Εργασίας |
|
||||
|
|
||||
Αρχικά, δημιουργούμε το δικό μας image για τον *nginx* ανάλογα με τις ανάγκες της υπηρεσίας μας. |
|
||||
|
|
||||
Το αποθηκεύουμε σε ένα αρχείο ονομάζοντας το [underline]#Dockerfile# |
|
||||
|
|
||||
Επόμενο βήμα είναι η εκτέλεση της παρακάτω εντολής για τη δημιουργία του image |
|
||||
|
|
||||
[source, console] |
|
||||
---- |
|
||||
docker build -f Dockerfile -t anginx . |
|
||||
---- |
|
||||
|
|
||||
[NOTE] |
|
||||
==== |
|
||||
Οptions: |
|
||||
|
|
||||
* -f προσδιορίζει το αρχείο για το build |
|
||||
* -t tag (το όνομα του image) |
|
||||
* "." είναι το current directory |
|
||||
==== |
|
||||
|
|
||||
Όλα τα services τα οποία θα τρέξουν στην εργασία μας βρίσκονται στο αρχείο [underline]#docker-compose.yml# |
|
||||
|
|
||||
Αναλυτικά: |
|
||||
|
|
||||
=== Nginx |
|
||||
|
|
||||
[source, yml] |
|
||||
---- |
|
||||
nginx: |
|
||||
image: anginx #image from docker building my Dockerfile (docker build -f Dockerfile -t anginx .) // <1> |
|
||||
container_name: production_nginx // <2> |
|
||||
volumes: // <3> |
|
||||
- /home/user/docker/nginx.conf:/etc/nginx/conf.d/default.conf |
|
||||
- /home/user/docker/cert.pem:/etc/nginx/public.crt |
|
||||
- /home/user/docker/key.pem:/etc/nginx/private.key |
|
||||
ports: // <4> |
|
||||
- 9080:80 |
|
||||
- 9443:443 |
|
||||
networks: // <5> |
|
||||
- main_net |
|
||||
---- |
|
||||
|
|
||||
=== MariaDB |
|
||||
[source, yml] |
|
||||
---- |
|
||||
mariadb: |
|
||||
image: mariadb // <1> |
|
||||
container_name: mariadb // <2> |
|
||||
volumes: // <3> |
|
||||
- db_data:/var/lib/mysql |
|
||||
environment: // <8> |
|
||||
MYSQL_ROOT_PASSWORD: wordpress |
|
||||
MYSQL_DATABASE: wordpress |
|
||||
networks: // <5> |
|
||||
- main_net |
|
||||
---- |
|
||||
|
|
||||
=== WordPress |
|
||||
[source, yml] |
|
||||
---- |
|
||||
wordpress: |
|
||||
image: wordpress:latest // <1> |
|
||||
container_name: wordpress // <2> |
|
||||
restart: always |
|
||||
deploy: #create replicas with specific resources // <6> |
|
||||
mode: replicated |
|
||||
replicas: 2 |
|
||||
# max_replicas_per_node: 1 |
|
||||
resources: |
|
||||
limits: #max resources |
|
||||
cpus: '0.50' |
|
||||
memory: 50M |
|
||||
reservations: #default resources |
|
||||
cpus: '0.25' |
|
||||
memory: 20M |
|
||||
ports: // <4> |
|
||||
- 80:80 |
|
||||
volumes: // <3> |
|
||||
- wp-app:/var/www/html |
|
||||
environment: // <8> |
|
||||
WORDPRESS_DB_HOST: mariadb:3306 |
|
||||
WORDPRESS_DB_NAME: wordpress |
|
||||
WORDPRESS_DB_USER: root |
|
||||
WORDPRESS_DB_PASSWORD: wordpress |
|
||||
networks: // <5> |
|
||||
- main_net |
|
||||
depends_on: // <7> |
|
||||
- mariadb |
|
||||
---- |
|
||||
|
|
||||
=== PHPMyAdmin |
|
||||
[source, yml] |
|
||||
---- |
|
||||
phpmyadmin: |
|
||||
image: phpmyadmin/phpmyadmin // <1> |
|
||||
container_name: phpmyadmin // <2> |
|
||||
deploy: // <6> |
|
||||
mode: replicated |
|
||||
replicas: 2 |
|
||||
# max_replicas_per_node: 1 |
|
||||
resources: |
|
||||
limits: |
|
||||
cpus: '0.50' |
|
||||
memory: 50M |
|
||||
reservations: |
|
||||
cpus: '0.25' |
|
||||
memory: 20M |
|
||||
environment: // <8> |
|
||||
PMA_HOST: mariadb |
|
||||
MYSQL_ROOT_PASSWORD: wordpress |
|
||||
PMA_PORT: 3306 |
|
||||
ports: // <4> |
|
||||
- 8080:80 |
|
||||
networks: // <5> |
|
||||
- main_net |
|
||||
---- |
|
||||
|
|
||||
=== Minio |
|=== |
||||
[source, yml] |
|| Όνομα | Επίθετο | Α.Μ. | Εξάμηνο |
||||
---- |
a|image::https://scontent-vie1-1.xx.fbcdn.net/v/t1.0-9/54214981_2057869304261440_7623539127601856512_n.jpg?_nc_cat=108&_nc_sid=85a577&_nc_eui2=AeHSo5gIOZOm523-cNGvvEJs0V_JeNsNOGfRX8l42w04Z4zNy9AMtJzrm1E5Cdz--TeqJ-OhIWZEsjIYb_JPyQkt&_nc_ohc=L24nIWfuDPYAX99hrLe&_nc_ht=scontent-vie1-1.xx&oh=9b642aea06780b7788d186db95e098da&oe=5F03529F[300,200]oh=29a75cf3e5b9f55daa8d2ad32f6038a9&oe=5F02A896[300,200] |
||||
minio1: |
{nbsp} + |
||||
image: minio/minio:RELEASE.2020-04-10T03-34-42Z // <1> |
| Βασίλης | Νικούλης | 131014 | 14ο |
||||
hostname: minio1 |
a|image::https://scontent.fath6-1.fna.fbcdn.net/v/t1.0-9/17553398_1825878917736266_734353228615435913_n.jpg?_nc_cat=105&_nc_sid=09cbfe&_nc_ohc=5d7zTSxYY2cAX8570ry&_nc_ht=scontent.fath6-1.fna&oh=29a75cf3e5b9f55daa8d2ad32f6038a9&oe=5F02A896[300,200] |
||||
volumes: // <3> |
{nbsp} +| Χρήστος | Ακρίδας | 131017 | 14ο |
||||
- minio1-data:/export |
a|image::https://scontent.fath3-3.fna.fbcdn.net/v/t1.0-9/87613519_220225952447362_6298983252308787200_o.jpg?_nc_cat=111&_nc_sid=7aed08&_nc_ohc=EiFQxfiy9CUAX_lEHfQ&_nc_ht=scontent.fath3-3.fna&oh=3e071eb0d44b053a631d1b7e388c16cd&oe=5F032A37[300,200] |
||||
ports: // <4> |
{nbsp} +| Κωνσταντίνος | Φυλακτόπουλος | 131024 | 14ο |
||||
- "9001:9000" |
a|image::https://scontent.fath4-2.fna.fbcdn.net/v/t1.0-9/69845032_10219874760649733_1240197254401228800_o.jpg?_nc_cat=104&_nc_sid=174925&_nc_ohc=6Y7BqUFR37oAX8tzYHC&_nc_ht=scontent.fath4-2.fna&oh=c2f26599fd851a3d34e72f27c466e471&oe=5F062CAD[300,200] |
||||
networks: // <5> |
{nbsp} +| Παναγιώτης | Καλομοίρης | 131048 | 14ο |
||||
- minio_distributed |
|=== |
||||
deploy: // <6> |
|
||||
restart_policy: |
|
||||
delay: 10s |
|
||||
max_attempts: 10 |
|
||||
window: 60s |
|
||||
placement: |
|
||||
constraints: |
|
||||
- node.labels.minio1==true |
|
||||
command: server http://minio{1...4}/export |
|
||||
environment: // <8> |
|
||||
MINIO_ACCESS_KEY: AKIAIOSFODNN7EXAMPLE |
|
||||
MINIO_SECRET_KEY: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY |
|
||||
# secrets: |
|
||||
# - secret_key |
|
||||
# - access_key |
|
||||
healthcheck: |
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] |
|
||||
interval: 30s |
|
||||
timeout: 20s |
|
||||
retries: 3 |
|
||||
---- |
|
||||
|
|
||||
=== Configuration Options: |
|
||||
:nofooter: |
|
||||
<1> image: Το image file από το οποίο θα τρέξει το service |
|
||||
<2> container_name: Είναι το όνομα του service |
|
||||
<3> volumes: "Mount host paths or named volumes from our VM to the service" |
|
||||
<4> ports: Είναι τα ports τα οποία κάνουμε expose "στον έξω" κόσμο |
|
||||
<5> networks: Είναι το εικονικό δίκτυο στο οποίο θα τρέξει το service |
|
||||
<6> deploy: Κάνουμε specify τα resources και τον αριθμό των replicas που θα τρέξουν |
|
||||
<7> depends_on: "Express dependency between services" |
|
||||
<8> environment: "Add environment variables" |
|
Loading…
Reference in new issue