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

Dockerize app

parent 97aa926c
No related branches found
No related tags found
2 merge requests!17Dockerize app,!10Draft: MigratingAnnotationCreation to MUI5.
Pipeline #1756 failed
# Use this variable to add configurations :
# docker-compose.yml : required
# ports.yml : bind the port 300 to the $PORT variable
# traefik.yml : add traefik configurations
COMPOSE_FILE=docker-compose.yml:docker/ports.yml
# Choose between "dev" and "prod"
ENV=dev
# If you use docker/ports.yml
PORT=3000
# If you use docker/traefik.yml
# A unique name for traefik router
NAME=
# A traefik host rule ex `domain.FQDN` or `domain1.FQDN`,`domain2.FQDN`
HOST=`domain.fqdn`
......@@ -7,3 +7,5 @@
npm-debug.log*
.idea
.package-lock.json
.env
.*.sw?
# mirador-annotations
## Install
## Install (local)
```
nvm use
......@@ -25,6 +25,18 @@ npm install
![annotation creation panel](https://user-images.githubusercontent.com/5402927/86628717-23c3ae80-bf7f-11ea-8f0b-389c39eb4398.png)
## Install using docker
This method requires `docker` and `docker-compose` (or `docker compose`)
```
cp .env.sample .env
$EDITOR .env
# Change the variables you need
docker-compose up
```
## Persisting Annotations
Persisting annotations requires implementing an a IIIF annotation server. Several [examples of annotation servers](https://github.com/IIIF/awesome-iiif#annotation-servers) are available on iiif-awesome.
......
version: "3"
services:
front:
build:
context: "docker/"
volumes:
- ${PWD}:/app
environment:
ENV:
FROM node:16
EXPOSE 3000
VOLUME /app
WORKDIR /app
RUN npm install -g serve
COPY entrypoint.sh /
USER node
ENTRYPOINT ["/entrypoint.sh"]
#!/bin/bash
npm install
./cli post_install
if [ "$ENV" == "prod" ]; then
npm run build
cmd="serve -s demo/dist"
else
cmd="npm start"
fi
if [ ! -z "$1" ]; then
cmd=$@
fi
exec $cmd
version: "3"
services:
front:
ports:
- ${PORT}:3000
version: '3'
services:
front:
networks:
- 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