Skip to content
Snippets Groups Projects
Verified Commit 2d45d740 authored by David Beniamine's avatar David Beniamine
Browse files

Production mode for all services

Closes #10
Closes #16
parent 66909377
No related branches found
No related tags found
1 merge request!8Customize annotot endpoint and environment
# docker-compose components replace by devserver.yml to run the dev server (default is prod) or append ':devserver.yml' to run both
#COMPOSE_FILE=docker-compose.yml:devserver.yml:annotot.yml
#COMPOSE_FILE=docker-compose.yml:annotot.yml
COMPOSE_FILE=devserver.yml:annotot.yml
# COMPOSE_FILE :
# + 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
PORT=8080
# prod container restart policy
......@@ -26,3 +29,6 @@ ANNOTOT_LISTEN_IP=0.0.0.0
ANNOTOT_HOST=localhost
# For production only
ANNOTOT_SECRET_KEY_BASE=insert-a-random-key-here
# For traefik (optionnal)
NAME=IIIF
HOST=IIIF.tetras-lab.io
## Mirador Video Annotation POC
### Install
Copy `.env.template` to `.env` and change variables to suit your need.
You **MUST** set at least the `ANNOTOT_SECRET_KEY_BASE` to a random string, the rest is preconfigured for a local development environment.
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
### Production
For production, one **also** need to setup :
+ `COMPOSE_FILE` should be at least `docker-compose.yml:annotot.yml`
......@@ -12,12 +21,16 @@ For production, one **also** need to setup :
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.
#### Traefik
If sources files are modified, run `docker-compose up -d --build` to update Mirador
We provide a `traefik.yml` file to use behind [traefik](https://traefik.io/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
#### Use the development server
#### Developpement
Follow the previous instructions if you want to access ressources from `$HTTP_FOLDER` via HTTP in the devserver.
......
version: "3.9"
services:
annotot:
image: tetraslibre/annotot-app
ports:
- ${ANNOTOT_PORT}:3000
environment:
- IP=${ANNOTOT_LISTEN_IP}
- ENV=${ANNOTOT_ENV}
- SECRET_KEY_BASE=${ANNOTOT_SECRET_KEY_BASE}
volumes:
- ./annotot-db:/app/db
......@@ -3,11 +3,18 @@ services:
httpd:
build: .
restart: $RESTART
ports:
- $PORT:80
environment:
- CORS_ALLOWED_HOSTS
- WEBPACK_MODE=production
volumes:
- $HTTP_FOLDER:/srv/data
- ./Caddyfile:/etc/caddy/Caddyfile
annotot:
image: tetraslibre/annotot-app
environment:
- IP=${ANNOTOT_LISTEN_IP}
- ENV=${ANNOTOT_ENV}
- SECRET_KEY_BASE=${ANNOTOT_SECRET_KEY_BASE}
volumes:
- ./annotot-db:/app/db
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment