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

Production mode for all services

Closes #16
parent 021e5f3d
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=docker-compose.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
......@@ -14,3 +19,5 @@ HTTP_FOLDER=./www
# hosts allowed to access ressources from $HTTP_FOLDER
# * to allow all, http://localhost:$DEV_PORT to allow only devserver
CORS_ALLOWED_HOSTS=http://localhost:$DEV_PORT
NAME=IIIF
HOST=IIIF.tetras-lab.io
## Mirador Video Annotation POC
Copy `.env.template` to `.env` and change variables to suit your need (you can skip the edit step)
Run `docker-compose up -d`, which will serve a mirador instance at `http://localhost:$PORT` (default port is 8080).
### Install
Copy `.env.template` to `.env` and change variables to suit your need.
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
#### Traefik
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.
......
......@@ -14,3 +14,7 @@ services:
- DEV_PORT
volumes:
- ./:/opt
httpd:
ports:
- $PORT:80
......@@ -3,8 +3,6 @@ services:
httpd:
build: .
restart: $RESTART
ports:
- $PORT:80
environment:
- CORS_ALLOWED_HOSTS
- WEBPACK_MODE=production
......
version: "3.9"
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