Skip to content

Commit

Permalink
Add docker config for example app
Browse files Browse the repository at this point in the history
  • Loading branch information
insspb committed Jul 1, 2022
1 parent 94927cb commit 0de51bd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: "3.3"
volumes:
db_data: {}

services:
mongo:
image: mongo:4.4
volumes:
- db_data:/data/db/
ports:
- 27017:27017
restart: always

flask:
build:
context: .
dockerfile: ./example_app/compose/flask/Dockerfile
depends_on:
- mongo
command: python ./example_app/app.py
ports:
- 8000:8000
volumes:
- ./:/flask_mongoengine
restart: always
9 changes: 9 additions & 0 deletions example_app/compose/flask/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.7-slim as dev

ENV PYTHONUNBUFFERED 1
RUN groupadd -r flask && useradd -r -g flask flask
COPY --chown=flask . /flask_mongoengine
RUN pip install --upgrade pip \
&& pip install -r /flask_mongoengine/requirements.txt \
&& pip install -e /flask_mongoengine
WORKDIR /flask_mongoengine

0 comments on commit 0de51bd

Please sign in to comment.