update docker

add port exposure for webgui
add mariadb to docker compose
This commit is contained in:
jeanGaston 2024-01-30 08:31:02 +01:00
parent 6e1d578a70
commit 181b90f822
2 changed files with 21 additions and 2 deletions

View File

@ -7,8 +7,11 @@ WORKDIR /app
# Copy the script1.py and any other necessary files # Copy the script1.py and any other necessary files
COPY ./Helloworld.py /app/ COPY ./Helloworld.py /app/
#expose port
EXPOSE 5000
# Install any dependencies # 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 # Set the entry point
CMD ["python", "Helloworld.py"] CMD ["python", "Helloworld.py"]

View File

@ -10,4 +10,20 @@ services:
build: build:
context: ./WebGui context: ./WebGui
dockerfile: ./DOCKERFILE dockerfile: ./DOCKERFILE
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/