From d4f8350bd264c14dbfdd12f21b145ac6ccc912fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Thu, 24 Mar 2022 09:03:37 +0800 Subject: fix "AttributeError: module 'collections' has no attribute 'Iterable' flask" caused by python --- .db.env.example | 3 +++ .gitignore | 1 + Dockerfile | 8 ++++---- docker-compose.yml | 12 ++++++------ 4 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 .db.env.example diff --git a/.db.env.example b/.db.env.example new file mode 100644 index 0000000..7ecae99 --- /dev/null +++ b/.db.env.example @@ -0,0 +1,3 @@ +MONGO_INITDB_ROOT_USERNAME=root # changeme +MONGO_INITDB_ROOT_PASSWORD=example # changeme +MONGO_INITDB_DATABASE=admin diff --git a/.gitignore b/.gitignore index c8b59c8..1c1c140 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ instance/* !instance/.gitignore .webassets-cache .env +.db.env ### Flask.Python Stack ### # Byte-compiled / optimized / DLL files diff --git a/Dockerfile b/Dockerfile index 66377f9..07720f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3-alpine AS base +FROM python:3.9-alpine AS base LABEL MAINTAINER="heckyel@riseup.net" FROM base AS builder @@ -13,9 +13,9 @@ RUN mkdir --parents "$APP_DIR" WORKDIR "$APP_DIR" -COPY database /srv/app -COPY routes /srv/app -COPY utils /srv/app +COPY database /srv/app/database +COPY routes /srv/app/routes +COPY utils /srv/app/utils COPY config.py /srv/app COPY main.py /srv/app COPY wsgi.py /srv/app diff --git a/docker-compose.yml b/docker-compose.yml index c788f43..e1102a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,8 @@ -version: '3' +version: '3.5' services: app: - image: rusian/heroeapi + image: rusian/heroesapi container_name: heroeapi env_file: .env networks: @@ -15,17 +15,17 @@ services: mongo: image: mongo:4.4.12-focal container_name: heroeapi_db + networks: + - heroeapi restart: always command: [--auth] env_file: - .db.env - networks: - - heroeapi volumes: - ./heroeapi_db:/data/db ports: - "27017:27017" networks: - default: - name: heroeapi + heroeapi: + driver: bridge -- cgit v1.2.3