aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.db.env.example3
-rw-r--r--.gitignore1
-rw-r--r--Dockerfile8
-rw-r--r--docker-compose.yml12
4 files changed, 14 insertions, 10 deletions
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