From e86615705295b2a95d2122afd44a345f2f6a5bd7 Mon Sep 17 00:00:00 2001 From: egyhaty Date: Mon, 4 Dec 2023 07:42:15 +0200 Subject: [PATCH] Push app --- Dockerfile | 11 ++++++++--- docker-compose.yml | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index adc6eaf4..58fe70b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,10 @@ FROM python:latest -COPY . . -CMD python3 -m pip install -r requirements/docs.txt -RUN python3 -m flask run +WORKDIR /src/flask + +COPY ./examples/tutorial /src/flask + +RUN pip install -e . +RUN pip install --upgrade pip +RUN flask --app flaskr init-db +CMD flask --app flaskr run --debug --host 0.0.0.0 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..a7ca7f7e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: '3.8' + +services: + mysqldb: + image: mysql:8.0 + restart: unless-stopped + env_file: ./.env + ports: + - 3306:3306 + volumes: + - db:/var/lib/mysql + app: + depends_on: + - mysqldb + build: ./ + restart: unless-stopped + env_file: ./.env + ports: + - 8080:8080 + stdin_open: true + tty: true + +volumes: + db: