forked from geobretagne/mreport
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
spelhate
committed
May 26, 2020
1 parent
c75550e
commit 0ce5193
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: '3' | ||
volumes: | ||
reports: | ||
|
||
services: | ||
|
||
# Select between the next 2 services the backend you want to use by | ||
# commenting / uncommenting the 'volume' section & modify the links alias | ||
# on the mviewer-studio service. | ||
# | ||
# You cannot use both backends at the same time, and you have to be wary if | ||
# you switch from one to another, as each comes with a custom config.json | ||
# file. | ||
# | ||
# If you want to switch, make sure either you modify the config.json, or | ||
# reinitialize the docker volume. | ||
|
||
|
||
# Python version | ||
mreport-backend: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile-backend | ||
image: mreport/mreport:python-latest | ||
volumes: | ||
- "reports:/home/apprunner/backend/reports" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM python:3.7-slim | ||
|
||
RUN useradd -r -m apprunner | ||
|
||
USER apprunner | ||
|
||
ENV HOME=/home/apprunner | ||
ENV PATH=$HOME/.local/bin:$PATH | ||
|
||
WORKDIR /home/apprunner | ||
|
||
COPY requirements.txt . | ||
COPY config.py . | ||
RUN pip install --user -r requirements.txt | ||
|
||
COPY --chown=apprunner:apprunner backend backend | ||
RUN pip install --user backend && pip install --user gunicorn | ||
|
||
|
||
VOLUME [ "/home/apprunner/backend/reports" ] | ||
|
||
|
||
CMD ["gunicorn", "-w 4", "-b 0.0.0.0:8000", "backend:app"] |