-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #280 from mviewer/develop
v4.0.1
- Loading branch information
Showing
37 changed files
with
820 additions
and
532 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
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
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
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
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
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 |
---|---|---|
@@ -1,61 +1,53 @@ | ||
version: '3' | ||
volumes: | ||
apps: | ||
mviewerstudio_config: | ||
|
||
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. | ||
|
||
# PHP version | ||
mviewerstudio-php: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile-php-backend | ||
image: mviewer/mviewerstudio:php-latest | ||
# volumes: | ||
# - "apps:/var/www/html/apps" | ||
# Reverse-proxy using nginx. Groups mviewer and mviewerstudio under respective paths | ||
# Config can be found under ./docker/nginx/default.conf.template | ||
www: | ||
image: nginx | ||
ports: | ||
- 80:80 | ||
environment: | ||
- NGINX_HOST=localhost | ||
- MVIEWERSTUDIO_URL_PATH_PREFIX=mviewerstudio | ||
volumes: | ||
- ./docker/nginx:/etc/nginx/templates | ||
depends_on: | ||
- mviewerstudio | ||
- mviewer | ||
|
||
# Python version | ||
mviewerstudio-python: | ||
# Served under /${MVIEWERSTUDIO_URL_PATH_PREFIX}/ see docker/nginx/default.conf.template | ||
mviewerstudio: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile-python-backend | ||
image: mviewer/mviewerstudio:python-latest | ||
image: mviewer/mviewerstudio:latest | ||
# ports: | ||
# - "8000:8000" | ||
environment: | ||
- CONF_PATH_FROM_MVIEWER=apps/store | ||
- CONF_PUBLISH_PATH_FROM_MVIEWER=apps/public | ||
- DEFAULT_ORG=my_org | ||
- EXPORT_CONF_FOLDER=/home/apprunner/apps/store | ||
- MVIEWERSTUDIO_PUBLISH_PATH=/home/apprunner/apps/public | ||
- MVIEWERSTUDIO_URL_PATH_PREFIX=mviewerstudio | ||
volumes: | ||
- "apps:/home/apprunner/apps" | ||
- "mviewerstudio_config:/home/apprunner/mviewerstudio_backend/static/apps" | ||
- "./docker/config-docker-python.json:/home/apprunner/mviewerstudio_backend/static/apps/config.json" | ||
- "./config-python-sample.json:/home/apprunner/mviewerstudio_backend/static/apps/config.json" | ||
|
||
# Served under /mviewer/ see docker/nginx/default.conf.template | ||
mviewer: | ||
depends_on: | ||
- mviewerstudio | ||
# this image is automatically built in | ||
# the mviewer/mviewer github repository | ||
# See https://github.com/mviewer/mviewer/pull/236 | ||
image: mviewer/mviewer | ||
# ports: | ||
# - "5051:80" | ||
volumes: | ||
- "apps:/usr/share/nginx/html/apps" | ||
links: | ||
- mviewerstudio-php | ||
- mviewerstudio-python | ||
|
||
mviewer-studio: | ||
image: nginx:1.17.9 | ||
volumes: | ||
- "./docker/nginx-default.conf:/etc/nginx/conf.d/default.conf" | ||
ports: | ||
- "8080:8080" | ||
links: | ||
- mviewer | ||
# use the correct link entry below, depending on the selected | ||
# backend | ||
#- mviewerstudio-php:mviewerstudio | ||
- mviewerstudio-python:mviewerstudio | ||
# |
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 |
---|---|---|
@@ -1,35 +1,47 @@ | ||
FROM python:3.8-slim | ||
FROM python:3.11-slim | ||
|
||
#install git & studio dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
libxml2-dev \ | ||
libxslt1-dev \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN useradd -r -m apprunner | ||
|
||
USER apprunner | ||
|
||
ENV HOME=/home/apprunner | ||
ENV PATH=$HOME/.local/bin:$PATH | ||
ENV EXPORT_CONF_FOLDER=/home/apprunner/apps/store | ||
|
||
RUN mkdir -p /home/apprunner/apps/store | ||
RUN chown -R apprunner:apprunner /home/apprunner/apps | ||
|
||
WORKDIR /home/apprunner | ||
|
||
COPY srv/python/requirements.txt . | ||
RUN pip install --user -r requirements.txt | ||
|
||
COPY --chown=apprunner:apprunner srv/python . | ||
RUN pip install --user . && pip install --user gunicorn | ||
|
||
RUN rm -rf mviewerstudio_backend/static/* | ||
# We need to install the app so that the config is properly read (there might be something to fix on | ||
# app-factory.py, calling app.config.from_object requires the package to be installed | ||
RUN pip install --user -r requirements.txt && pip install --user . | ||
|
||
VOLUME [ "/home/apprunner/apps" ] | ||
|
||
COPY css/ mviewerstudio_backend/static/css | ||
COPY img/ mviewerstudio_backend/static/img | ||
COPY index.html mviewerstudio_backend/static/index.html | ||
COPY mviewerstudio.i18n.json mviewerstudio_backend/static/mviewerstudio.i18n.json | ||
COPY js/ mviewerstudio_backend/static/js | ||
COPY lib/ mviewerstudio_backend/static/lib | ||
COPY *.json mviewerstudio_backend/static/ | ||
COPY docker/config-docker-python.json mviewerstudio_backend/static/apps/config.json | ||
COPY mviewerstudio.i18n.json mviewerstudio_backend/static/mviewerstudio.i18n.json | ||
|
||
ENV EXPORT_CONF_FOLDER=/home/apprunner/apps/store \ | ||
CONF_PATH_FROM_MVIEWER=apps/store \ | ||
MVIEWERSTUDIO_PUBLISH_PATH=/home/apprunner/apps/public \ | ||
CONF_PUBLISH_PATH_FROM_MVIEWER=apps/public \ | ||
DEFAULT_ORG=public \ | ||
MVIEWERSTUDIO_URL_PATH_PREFIX=mviewerstudio/ | ||
|
||
# You will probably have to override this one on runtime with your custom config | ||
COPY config-python-sample.json mviewerstudio_backend/static/apps/config.json | ||
|
||
CMD ["gunicorn", "-w 4", "-b 0.0.0.0:8000", "mviewerstudio_backend.app:app"] |
Oops, something went wrong.