- build backend and frontend with cacheing using GHA cache) - streamline frontend image to reduce layers - setup local swarm with test/setup.sh script, wait for containers to init - copy sample config files as default (add storages.sample.yaml) - add initial backend test for logging in with default superadmin credentials via 127.0.0.1:9871 - must use 127.0.0.1 instead of localhost for accessing frontend container within action
148 lines
2.8 KiB
YAML
148 lines
2.8 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
backend:
|
|
build: ./backend
|
|
image: ${REGISTRY}webrecorder/browsertrix-backend:latest
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
configs:
|
|
- shared_job_config
|
|
|
|
secrets:
|
|
- storages
|
|
|
|
env_file:
|
|
- ./configs/config.env
|
|
|
|
depends_on:
|
|
- minio
|
|
- mongo
|
|
|
|
# enable to expose backend api container directly
|
|
# ports:
|
|
# - 8000:8000
|
|
|
|
environment:
|
|
- CRAWLER_FQDN_SUFFIX=
|
|
- JOB_IMAGE=${REGISTRY}webrecorder/browsertrix-backend:latest
|
|
|
|
deploy:
|
|
placement:
|
|
constraints:
|
|
- node.role == manager
|
|
|
|
frontend:
|
|
build: ./frontend
|
|
image: ${REGISTRY}webrecorder/browsertrix-frontend:latest
|
|
ports:
|
|
- 9871:80
|
|
|
|
depends_on:
|
|
- backend
|
|
- minio
|
|
|
|
environment:
|
|
- BACKEND_HOST=backend
|
|
- CRAWLER_FQDN_SUFFIX=
|
|
- CRAWLER_SVC_SUFFIX=
|
|
|
|
swarm-cronjob:
|
|
image: crazymax/swarm-cronjob
|
|
volumes:
|
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
|
|
|
environment:
|
|
- "TZ=UTC"
|
|
- "LOG_LEVEL=debug"
|
|
- "LOG_JSON=false"
|
|
|
|
deploy:
|
|
placement:
|
|
constraints:
|
|
- node.role == manager
|
|
|
|
prune-resources:
|
|
image: docker
|
|
command: ["docker", "volumes", "prune", "-f", "--filter", "label=crawl"]
|
|
volumes:
|
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
|
deploy:
|
|
mode: global
|
|
labels:
|
|
- "swarm.cronjob.enable=true"
|
|
- "swarm.cronjob.schedule=0 */5 * * *"
|
|
- "swarm.cronjob.skip-running=false"
|
|
restart_policy:
|
|
condition: none
|
|
|
|
mongo:
|
|
image: mongo
|
|
volumes:
|
|
- btrix-mongo-data:/data/db
|
|
|
|
env_file:
|
|
- ./configs/config.env
|
|
|
|
minio:
|
|
image: minio/minio
|
|
#command: ["server", "/data", "--console-address", ":9001"]
|
|
|
|
entrypoint: "/bin/sh"
|
|
# auto-create bucket via existing dir (only for single-node mode)
|
|
command: ["-c", "mkdir -p /data/$$MINIO_BUCKET; /usr/bin/docker-entrypoint.sh server /data --console-address :9001"]
|
|
|
|
volumes:
|
|
- btrix-minio-data:/data
|
|
|
|
env_file:
|
|
- ./configs/config.env
|
|
|
|
# enable below to access minio console directly
|
|
# ports:
|
|
# - 9001:9001
|
|
#
|
|
# environment:
|
|
# - MINIO_SERVER_URL=http://127.0.0.1:9000
|
|
|
|
|
|
# enable to support signing of wacz files
|
|
# port 80 must be open to automatically generate cert via LetsEncrypt
|
|
# authsign:
|
|
# image: webrecorder/authsign:0.4.0
|
|
|
|
# volumes:
|
|
# - btrix-sign-data:/data
|
|
# - ./configs/signing.yaml:/app-config/signing.yaml
|
|
|
|
# environment:
|
|
# - CONFIG=/app-config/signing.yaml
|
|
|
|
# env_file:
|
|
# - ./configs/config.env
|
|
|
|
# ports:
|
|
# - 80:80
|
|
|
|
volumes:
|
|
btrix-redis-data:
|
|
btrix-mongo-data:
|
|
btrix-minio-data:
|
|
btrix-sign-data:
|
|
|
|
networks:
|
|
default:
|
|
name: btrix-net
|
|
|
|
configs:
|
|
shared_job_config:
|
|
file: ./configs/config.yaml
|
|
|
|
secrets:
|
|
storages:
|
|
file: ./configs/storages.yaml
|
|
|
|
|
|
|