Skip to content
Snippets Groups Projects
Commit 9cfd5cb9 authored by David Beniamine's avatar David Beniamine
Browse files

Merge branch '16-production-mode' into 'main'

Production mode for all services

Closes #16

See merge request iiif/POC-mirador!9
parents 021e5f3d 26d49229
No related branches found
No related tags found
1 merge request!9Production mode for all services
# docker-compose components replace by devserver.yml to run the dev server (default is prod) or append ':devserver.yml' to run both # COMPOSE_FILE :
COMPOSE_FILE=docker-compose.yml # + docker-compose.yml = production service, no port exposed
# + docker-compose.yml:dev.yml = production service + devserver, front services ports are exposed
# + docker-compose.yml:traefik.yml = production services + traefik mapping (see README)
COMPOSE_FILE=docker-compose.yml:dev.yml
#COMPOSE_FILE=docker-compose.yml
#COMPOSE_FILE=docker-compose.yml:traefik.yml
# prod server host port # prod server host port
PORT=8080 PORT=8080
# prod container restart policy # prod container restart policy
...@@ -14,3 +19,5 @@ HTTP_FOLDER=./www ...@@ -14,3 +19,5 @@ HTTP_FOLDER=./www
# hosts allowed to access ressources from $HTTP_FOLDER # hosts allowed to access ressources from $HTTP_FOLDER
# * to allow all, http://localhost:$DEV_PORT to allow only devserver # * to allow all, http://localhost:$DEV_PORT to allow only devserver
CORS_ALLOWED_HOSTS=http://localhost:$DEV_PORT CORS_ALLOWED_HOSTS=http://localhost:$DEV_PORT
NAME=IIIF
HOST=IIIF.tetras-lab.io
## Mirador Video Annotation POC ## Mirador Video Annotation POC
Copy `.env.template` to `.env` and change variables to suit your need (you can skip the edit step) ### What is this repository
This is a [Mirador](https://projectmirador.org/) based application that provides video annotation edition features :
+ [x] Video rendering in mirador base on the work of [Tokyo university](https://github.com/2SC1815J/mirador)
+ [x] Annotation persistance using [annotot](https://github.com/PenguinParadigm/annotot)
+ [x] Manifest storage and persistance
+ [-] Annotation on video (currently only working on images)
+ [ ] Multi user and per-user workspace
### Requirements
+ [docker](https://docs.docker.com/)
+ [docker-compose](https://docs.docker.com/compose/install/)
This readme assumes that you now a few basic about `docker` and `docker-compose`, if you are not familliar with `docker-compose` we recommand to read [the documentation](https://docs.docker.com/compose/) first.
### Install
Copy `.env.template` to `.env` and change variables to suit your need.
Run `docker-compose up -d`, which will serve a mirador instance at `http://localhost:$PORT` (default port is 8080).
The `$HTTP_FOLDER` (`./www` by default) directory will be accessible via HTTP at `http://localhost:$PORT/data` and can be used to store manifests and theirs ressources and see them in Mirador. The `$HTTP_FOLDER` (`./www` by default) directory will be accessible via HTTP at `http://localhost:$PORT/data` and can be used to store manifests and theirs ressources and see them in Mirador.
If sources files are modified, run `docker-compose up -d --build` to update Mirador Run `docker-compose up -d`, which will serve a mirador instance at `http://localhost:$DEV_PORT` (default port is 9000) with live rebuild/reload enabled on each `src/` and `public/` files modifications.
### Production
#### Use the development server For production, one **also** need to setup :
Follow the previous instructions if you want to access ressources from `$HTTP_FOLDER` via HTTP in the devserver. + `COMPOSE_FILE` should be at least `docker-compose.yml`
Run `docker-compose up -d`, which will serve a mirador instance at `http://localhost:$PORT` (default port is 8080).
If sources files are modified, run `docker-compose up -d --build` to update Mirador
Edit `.env` (copy it from `.env.template` if needed), set `COMPOSE_FILE=docker-compose.yml:devserver.yml` and adapt `DEV_*` variables to your needs. #### Traefik
Run `docker-compose up -d --build devserver`, which will serve a mirador instance at `http://localhost:$DEV_PORT` (default port is 9000) with live rebuild/reload enabled on each `src/` and `public/` files modifications. We provide a `traefik.yml` file to use behind [traefik](https://traefik.io/) this file does the following assumptions :
+ A traefik container exists and is running in an external docker network called `traefik`
+ Traefik has a tls resolver called `myresolver`
+ Traefik has a middleware called `hardening@docker` that adds the usual security headers
version: "3.9" version: "3.3"
services: services:
devserver: devserver:
build: build:
...@@ -14,3 +14,7 @@ services: ...@@ -14,3 +14,7 @@ services:
- DEV_PORT - DEV_PORT
volumes: volumes:
- ./:/opt - ./:/opt
httpd:
ports:
- $PORT:80
version: "3.9" version: "3.3"
services: services:
httpd: httpd:
build: . build: .
restart: $RESTART restart: $RESTART
ports:
- $PORT:80
environment: environment:
- CORS_ALLOWED_HOSTS - CORS_ALLOWED_HOSTS
- WEBPACK_MODE=production - WEBPACK_MODE=production
......
version: "3.3"
services:
httpd:
networks:
- default
- traefik
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.${NAME}.rule=Host(`${HOST}`)"
- "traefik.http.routers.${NAME}.tls.certresolver=myresolver"
- "traefik.http.routers.${NAME}.entrypoints=web,websecure"
- "traefik.http.routers.${NAME}.middlewares=hardening@docker"
networks:
traefik:
external: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment