From 181b90f8222b468c6fcf3cb2219ff412a249a16c Mon Sep 17 00:00:00 2001 From: jeanGaston Date: Tue, 30 Jan 2024 08:31:02 +0100 Subject: [PATCH] update docker add port exposure for webgui add mariadb to docker compose --- WebGui/DOCKERFILE | 5 ++++- docker-compose.yml | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/WebGui/DOCKERFILE b/WebGui/DOCKERFILE index e19514b..2ce2196 100644 --- a/WebGui/DOCKERFILE +++ b/WebGui/DOCKERFILE @@ -7,8 +7,11 @@ WORKDIR /app # Copy the script1.py and any other necessary files COPY ./Helloworld.py /app/ +#expose port +EXPOSE 5000 + # Install any dependencies -RUN pip install --no-cache-dir Flask==2.1.2 +RUN pip install --no-cache-dir -r ./requirements.py # Set the entry point CMD ["python", "Helloworld.py"] diff --git a/docker-compose.yml b/docker-compose.yml index 1aec051..391c406 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,4 +10,20 @@ services: build: context: ./WebGui dockerfile: ./DOCKERFILE - \ No newline at end of file + ports: + - '80:5000' + + database: + image: 'mariadb:10.3' + container_name: database + restart: always + environment: + - MYSQL_USER: user + - MYSQL_PASSWORD: mypassword + - MYSQL_DATABASE: my_database + - MYSQL_ROOT_PASSWORD: rootpassword + + ports: + - '3306:3306' + volumes: + - ${PWD}/mariadb/:/var/lib/mysql/