docker compose files reorganisation

This commit is contained in:
nmaillat
2022-02-10 16:53:08 +01:00
parent 6ffef93697
commit f53e3eeebf
4 changed files with 66 additions and 93 deletions

49
.env
View File

@@ -28,6 +28,7 @@
# - "docker-compose.override.yml" : For dev only, use the code from hosts,
# activate ide debugger, ports mapping for
# datastores
# - "docker-compose.phrasea.yml" : For integrate this stack in the "traefik" of Phrasea stack"
#
#
#
@@ -36,23 +37,23 @@
# See available services and worker profiles below:
#
# Profiles service list:
# - "app" : launch Phraseanet and workers.
# - "gateway" : launch nginx service, alternate profils
- "gateway-traefik" : Nginx is launched behind traefik service (todo)
- "gateway-ps-traefik" : Nginx is launched behind a Traefik include in Phrasea Stack
# - "workers" : launch one worker container by kind of Jobs, you can also
# choose to launch only some workers, see worker list below.
# - "worker" : launch one container worker with all jobs run on it.
# - "db" : launch a mariadb container, because this is the primary
# datastore for production usage, use your own service.
# - "elastisearch" : launch a elasticsearch container.
# - "rabbitmq" : launch a rabbitmq container.
# - "redis" : launch a redis container.
# - "builder" : launch the builder container, for dev only.
# - "elk" : launch an elk stack, for dev only.
# - "squid" : reverse proxy for dev only.
# - "mailhog" : for catching all email emit by app for dev.
# - "db-backup" : launch and run a container to cron database backups and backup file's rotation.
# - "app" : launch Phraseanet and Workers.
# - "gateway-classic" : launch nginx service.
# - "gateway-traefik" : nginx is launched behind a traefik service, the traefik is include in this stack (todo)
# or Traefik include in Phrasea Stack.
# - "workers" : launch one worker container by kind of Jobs, you can also
# choose to launch only some workers, see worker list below.
# - "worker" : launch one container worker with all jobs run on it.
# - "db" : launch a mariadb container, because this is the primary
# datastore for production usage, use your own service.
# - "elastisearch" : launch a elasticsearch container.
# - "rabbitmq" : launch a rabbitmq container.
# - "redis" : launch a redis container.
# - "builder" : launch the builder container, for dev only.
# - "elk" : launch an elk stack, for dev only.
# - "squid" : reverse proxy for dev only.
# - "mailhog" : for catching all email emit by app for dev.
# - "db-backup" : launch and run a container to cron database backups and backup file's rotation.
#
# Profiles worker list:
# - "assetsInjest"
@@ -83,23 +84,23 @@
#
# For development:
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml:docker-compose.override.yml
# - COMPOSE_PROFILES=app,db,pma,elasticsearch,redis,rabbitmq,workers,mailhog,builder,gateway
# - COMPOSE_PROFILES=app,db,pma,elasticsearch,redis,rabbitmq,workers,mailhog,builder,gateway-classic
#
# For testing with debug:
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml
# - COMPOSE_PROFILES=app,db,pma,elasticsearch,rabbitmq,redis,worker,workers,mailhog,gateway
# - COMPOSE_PROFILES=app,db,pma,elasticsearch,rabbitmq,redis,worker,workers,mailhog,gateway-classic
#
# For testing with debug and SSL (the traekik is provide by Phrasea stack):
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml:docker-compose.alt-gateway.yml
# - COMPOSE_PROFILES=app,gateway,db,pma,elasticsearch,rabbitmq,redis,worker,workers,mailhog
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml:docker-compose.under-phrasea.yml
# - COMPOSE_PROFILES=app,gateway-traefik,db,pma,elasticsearch,rabbitmq,redis,worker,workers,mailhog
#
# For production (require using your own databases services and SSL):
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml:docker-compose.scheduler.yml
# - COMPOSE_PROFILES=app,workers,gateway
# - COMPOSE_PROFILES=app,workers,gateway-traefik
#
# Example with all profiles:
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml
# - COMPOSE_PROFILES=app,gateway,db,elasticsearch,redis,rabbitmq,pma,mailhog,assetsInjest,createRecord,deleteRecord,editRecord,
# - COMPOSE_PROFILES=app,gateway-classic,db,elasticsearch,redis,rabbitmq,pma,mailhog,assetsInjest,createRecord,deleteRecord,editRecord,
# exportMail,exposeUpload,exportFtp,mainQueue,populateIndex,pullAssets,recordsActions,subdefCreation,
# subtitle,validationReminder,webhook,writeMetadatas,scheduler,elk,db-backup
#
@@ -111,7 +112,7 @@ COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.too
# Define which profiles you want to use in "docker-compose".
# @run
COMPOSE_PROFILES=app,db,elasticsearch,rabbitmq,redis,worker,mailhog,db-backup
COMPOSE_PROFILES=app,gateway-classic,db,elasticsearch,rabbitmq,redis,worker,mailhog,db-backup

View File

@@ -1,68 +0,0 @@
version: "3.9"
networks:
phrasea:
external:
name: ${PS_NETWORK_NAME}
services:
gateway-treafik:
build:
context: .
target: phraseanet-nginx
args:
- SSH_PRIVATE_KEY=${PHRASEANET_SSH_PRIVATE_KEY}
- PHRASEANET_PLUGINS=${PHRASEANET_PLUGINS}
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-nginx:$PHRASEANET_DOCKER_TAG
profiles: ["gateway-traefik"]
restart: on-failure
volumes:
- ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
- ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
- ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
- ${PHRASEANET_PLUGINS_DIR}:/var/alchemy/Phraseanet/www/plugins:rw
depends_on:
- phraseanet
environment:
- MAX_BODY_SIZE
- GATEWAY_SEND_TIMEOUT
- GATEWAY_PROXY_TIMEOUT
- GATEWAY_FASTCGI_TIMEOUT
networks:
- internal
labels:
- "traefik.enable=true"
- "traefik.docker.network=${PS_NETWORK_NAME}"
- "traefik.http.routers.phraseanet.rule=Host(`${PHRASEANET_HOSTNAME}`)"
- "traefik.http.routers.phraseanet.tls=true"
gateway-pstreafik:
build:
context: .
target: phraseanet-nginx
args:
- SSH_PRIVATE_KEY=${PHRASEANET_SSH_PRIVATE_KEY}
- PHRASEANET_PLUGINS=${PHRASEANET_PLUGINS}
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-nginx:$PHRASEANET_DOCKER_TAG
profiles: ["gateway-ps-traefik"]
restart: on-failure
volumes:
- ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
- ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
- ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
- ${PHRASEANET_PLUGINS_DIR}:/var/alchemy/Phraseanet/www/plugins:rw
depends_on:
- phraseanet
environment:
- MAX_BODY_SIZE
- GATEWAY_SEND_TIMEOUT
- GATEWAY_PROXY_TIMEOUT
- GATEWAY_FASTCGI_TIMEOUT
networks:
- internal
- phrasea
labels:
- "traefik.enable=true"
- "traefik.docker.network=${PS_NETWORK_NAME}"
- "traefik.http.routers.phraseanet.rule=Host(`${PHRASEANET_HOSTNAME}`)"
- "traefik.http.routers.phraseanet.tls=true"

View File

@@ -0,0 +1,10 @@
version: "3.9"
networks:
phrasea:
external:
name: ${PS_NETWORK_NAME}
services:
gateway-traefik:
networks:
- phrasea

View File

@@ -15,7 +15,7 @@ services:
- SSH_PRIVATE_KEY=${PHRASEANET_SSH_PRIVATE_KEY}
- PHRASEANET_PLUGINS=${PHRASEANET_PLUGINS}
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-nginx:$PHRASEANET_DOCKER_TAG
profiles: ["gateway"]
profiles: ["gateway-classic"]
restart: on-failure
volumes:
- ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
@@ -34,6 +34,36 @@ services:
networks:
- internal
gateway-treafik:
build:
context: .
target: phraseanet-nginx
args:
- SSH_PRIVATE_KEY=${PHRASEANET_SSH_PRIVATE_KEY}
- PHRASEANET_PLUGINS=${PHRASEANET_PLUGINS}
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-nginx:$PHRASEANET_DOCKER_TAG
profiles: ["gateway-traefik"]
restart: on-failure
volumes:
- ${PHRASEANET_DATA_DIR}:/var/alchemy/Phraseanet/datas:rw
- ${PHRASEANET_THUMBNAILS_DIR}:/var/alchemy/Phraseanet/www/thumbnails:rw
- ${PHRASEANET_CUSTOM_DIR}:/var/alchemy/Phraseanet/www/custom:rw
- ${PHRASEANET_PLUGINS_DIR}:/var/alchemy/Phraseanet/www/plugins:rw
depends_on:
- phraseanet
environment:
- MAX_BODY_SIZE
- GATEWAY_SEND_TIMEOUT
- GATEWAY_PROXY_TIMEOUT
- GATEWAY_FASTCGI_TIMEOUT
networks:
- internal
labels:
- "traefik.enable=true"
- "traefik.docker.network=${PS_NETWORK_NAME}"
- "traefik.http.routers.phraseanet.rule=Host(`${PHRASEANET_HOSTNAME}`)"
- "traefik.http.routers.phraseanet.tls=true"
phraseanet:
build:
context: .