Skip to content

Commit 0de51bd

Browse files
committed
Add docker config for example app
1 parent 94927cb commit 0de51bd

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

docker-compose.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: "3.3"
2+
volumes:
3+
db_data: {}
4+
5+
services:
6+
mongo:
7+
image: mongo:4.4
8+
volumes:
9+
- db_data:/data/db/
10+
ports:
11+
- 27017:27017
12+
restart: always
13+
14+
flask:
15+
build:
16+
context: .
17+
dockerfile: ./example_app/compose/flask/Dockerfile
18+
depends_on:
19+
- mongo
20+
command: python ./example_app/app.py
21+
ports:
22+
- 8000:8000
23+
volumes:
24+
- ./:/flask_mongoengine
25+
restart: always

example_app/compose/flask/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.7-slim as dev
2+
3+
ENV PYTHONUNBUFFERED 1
4+
RUN groupadd -r flask && useradd -r -g flask flask
5+
COPY --chown=flask . /flask_mongoengine
6+
RUN pip install --upgrade pip \
7+
&& pip install -r /flask_mongoengine/requirements.txt \
8+
&& pip install -e /flask_mongoengine
9+
WORKDIR /flask_mongoengine

0 commit comments

Comments
 (0)