From 6be226a6f7bbe96ca0719adf54c707ccdec4bdf7 Mon Sep 17 00:00:00 2001 From: u1 Date: Wed, 6 Nov 2024 09:27:44 +0000 Subject: [PATCH] docker compose v0.01 --- docker-compose.yaml | 72 +++++++++++++++++++++++++++++++++++++++++++++ fapi | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..a9911a2 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,72 @@ +version: '3.7' + +services: + + # Usługa admin + admin: + build: + context: ./ + dockerfile: ./admin/Dockerfile # Dockerfile znajduje się w ./admin + container_name: admin_service + volumes: + - ./app:/home/user/work # Mapowanie katalogu app do kontenera + ports: + - '3333:3333' # Mapowanie portu dla serwera HTTP + restart: always + + # Usługa fapi + fapi: + build: + context: ./fapi + dockerfile: Dockerfile # Dockerfile znajduje się w ./fapi + container_name: fapi_service + environment: + - PYTHONUNBUFFERED=1 + volumes: + - ./fapi:/home/user/fapi # Mapowanie katalogu fapi do kontenera + depends_on: + - mysql-server # fapi zależy od mysql-server + ports: + - '8888:8888' # Port dla aplikacji fapi + restart: always + command: bash -c "python entrypoint.py" + + # Usługa web-server (część stosu LAMP) + web-server: + build: + context: ./lamp + dockerfile: Dockerfile # Dockerfile znajduje się w ./lamp + container_name: lamp_web_server + volumes: + - ./lamp/html:/var/www/html # Mapowanie katalogu html do kontenera + ports: + - '8080:80' # Port dla serwera WWW + restart: always + + # Usługa mysql-server (część stosu LAMP) + mysql-server: + image: mysql:8.0.19 + container_name: lamp_mysql + environment: + MYSQL_ROOT_PASSWORD: secret + volumes: + - mysql-data:/var/lib/mysql # Wolumen dla danych MySQL + ports: + - '3306:3306' # Port dla serwera MySQL + restart: always + + # Usługa phpmyadmin (część stosu LAMP) + phpmyadmin: + image: phpmyadmin/phpmyadmin:5.0.1 + container_name: lamp_phpmyadmin + environment: + PMA_HOST: mysql-server + PMA_USER: root + PMA_PASSWORD: secret + ports: + - '5000:80' # Port dla phpMyAdmin + restart: always + +volumes: + mysql-data: + diff --git a/fapi b/fapi index 859afea..4e1b405 160000 --- a/fapi +++ b/fapi @@ -1 +1 @@ -Subproject commit 859afea217a9027bbaf53e12c8efbff29ad71494 +Subproject commit 4e1b40521b7c3b56cd5ed95f0802c925e1d54445