##// END OF EJS Templates
dev: added s3 backend for development
dev: added s3 backend for development

File last commit:

r486:2a0080d9
r486:2a0080d9
Show More
docker-compose-services.yaml
361 lines | 9.7 KiB | text/x-yaml | YamlLexer
/ docker-compose-services.yaml
x-logging: &custom-logging
# docker plugin install grafana/loki-docker-driver:2.7.1 --alias loki --grant-all-permissions
# NOTE: loki logging driver ONLY works for host type networks...
driver: loki
options:
#loki-url: "http://${RC_LOKI_AUTH}loki:3100/loki/api/v1/push"
loki-url: "http://${RC_LOKI_AUTH}127.0.0.1:3100/loki/api/v1/push"
loki-retries: "5"
loki-timeout: "1s"
loki-max-backoff: "800ms"
volumes:
# volume for redis data store
redis_data:
labels:
"keep": 1
# volume for Postgres db store
# volume for Postgres Data
pg_data:
labels:
"keep": 1
# volume for MySQL Data
mysql_data:
labels:
"keep": 1
# volume for rhodecode elasticsearch
es_data:
labels:
"keep": 1
services:
channelstream:
networks:
- rhodecode_network
image: channelstream/channelstream:0.7.1
restart: always
# ports:
# - "127.0.0.1:8000:8000"
env_file:
- ${RC_ENV_FILE:?must-specify-rc-env-file}
command: ["channelstream"]
healthcheck:
test: curl -A RhodeCode-Healthcheck -s -o /dev/null -w '%{http_code}' http://channelstream:8000/admin/sign_in
# start_period+start_interval requires docker engine 25+
# how long the app starts with
start_period: 45s
# how often check for status during start_period time
start_interval: 5s
timeout: 30s
interval: 60s
retries: 10
volumes:
- confvolume:/etc/rhodecode/conf
logging:
*custom-logging
labels:
- "traefik.enable=true"
- "traefik.http.routers.channelstream.entrypoints=http"
- "traefik.http.routers.channelstream.priority=20"
- "traefik.http.routers.channelstream.rule=Host(`${RC_HOSTNAME:?must-specify-rhodecode-hostname}`) && PathPrefix(`/_channelstream`)"
- "traefik.http.routers.channelstream.service=channelstream-web"
- "traefik.http.routers.channelstream.middlewares=strip-cs"
- "traefik.http.middlewares.strip-cs.stripprefix.prefixes=/_channelstream"
- "traefik.http.services.channelstream-web.loadbalancer.server.port=8000"
# HTTP + SSL example, should be put into .custom/docker-compose-services.override.yaml
#- "traefik.http.routers.channelstream.entrypoints=http,https"
profiles:
["channelstream"]
nginx-statics:
# used to serve static files
networks:
- rhodecode_network
image: library/nginx:1.25.5
restart: always
environment:
NGINX_ENTRYPOINT_QUIET_LOGS: 1
env_file:
- ${RC_ENV_FILE:?must-specify-rc-env-file}
healthcheck:
test: curl -A RhodeCode-Healthcheck -s -o /dev/null -w '%{http_code}' --fail http://127.0.0.1:80/_health_static
# start_period+start_interval requires docker engine 25+
# how long the app starts with
start_period: 45s
# how often check for status during start_period time
start_interval: 5s
timeout: 30s
interval: 60s
retries: 10
# depends_on:
# - channelstream
volumes:
- $PWD/config/nginx/nginx_statics.conf:/etc/nginx/nginx.conf:ro
- $PWD/.custom/static_files:/var/opt/rhodecode_static_data
- rc_datavolume:/var/opt/rhodecode_data
logging:
*custom-logging
labels:
- "traefik.enable=true"
- "traefik.http.routers.nginx-statics.entrypoints=http"
- "traefik.http.routers.nginx-statics.priority=40"
- "traefik.http.routers.nginx-statics.rule=Host(`${RC_HOSTNAME:?must-specify-rhodecode-hostname}`) && PathPrefix(`/_static/rhodecode`, `/_pages`)"
- "traefik.http.routers.nginx-statics.service=nginx-serv"
- "traefik.http.services.nginx-serv.loadbalancer.server.port=80"
# HTTP + SSL example, should be put into .custom/docker-compose-services.override.yaml
#- "traefik.http.routers.nginx-statics.entrypoints=http, https"
nginx-errors:
networks:
- rhodecode_network
image: library/nginx:1.25.5
restart: always
environment:
NGINX_ENTRYPOINT_QUIET_LOGS: 1
env_file:
- ${RC_ENV_FILE:?must-specify-rc-env-file}
volumes:
- $PWD/config/nginx/nginx_errors.conf:/etc/nginx/nginx.conf:ro
- $PWD/config/nginx/error_pages:/etc/nginx/error_pages
- rc_datavolume:/var/opt/rhodecode_data
labels:
- "traefik.enable=true"
# error-middleware
- "traefik.http.middlewares.error-pages-middleware.errors.status=404"
- "traefik.http.middlewares.error-pages-middleware.errors.service=error-pages-service"
- "traefik.http.middlewares.error-pages-middleware.errors.query=/{status}.html"
# error handling router
- "traefik.http.routers.error-router.entrypoints=http"
- "traefik.http.routers.error-router.priority=5"
- "traefik.http.routers.error-router.rule=HostRegexp(`{host:.+}`)"
- "traefik.http.routers.error-router.service=error-pages-service"
- "traefik.http.routers.error-router.middlewares=error-pages-middleware"
- "traefik.http.services.error-pages-service.loadbalancer.server.port=80"
# HTTP + SSL example, should be put into .custom/docker-compose-services.override.yaml
#- "traefik.http.routers.error-router.entrypoints=http, https"
elasticsearch:
networks:
- rhodecode_network
image: elasticsearch:6.8.23
restart: always
environment:
- cluster.name=elasticsearch-cluster
- network.host=0.0.0.0
- bootstrap.memory_lock=true
- discovery.type=single-node
- cluster.routing.allocation.disk.threshold_enabled=false
- cluster.name=rhodecode-elasticsearch
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
env_file:
- ${RC_ENV_FILE:?must-specify-rc-env-file}
healthcheck:
# change port 80 to 443 when only using SSL
test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "elasticsearch:9200/_cat/health" ]
timeout: 30s
interval: 60s
retries: 10
# compat problems within some systems on settings those
#ulimits:
#memlock:
#soft: -1
#hard: -1
volumes:
- es_data:/usr/share/elasticsearch/data
logging:
*custom-logging
profiles:
["elasticsearch"]
redis:
networks:
- rhodecode_network
image: library/redis:7.2.5
restart: always
env_file:
- ${RC_ENV_FILE:?must-specify-rc-env-file}
command:
- "redis-server"
- "/etc/redis/redis.conf"
- "--maxmemory-policy allkeys-lru"
- "--maxmemory ${RC_REDIS_MAXMEMORY:?must-specify-redis-maxmemory}"
# ports:
# - "127.0.0.1::6379"
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 60s
volumes:
- $PWD/config/redis/redis.conf:/etc/redis/redis.conf:ro
- redis_data:/data
profiles:
["redis"]
logging:
*custom-logging
database:
networks:
- rhodecode_network
image: library/postgres:14.12
environment:
POSTGRES_DB: ${DB_NAME:?must-specify-db-name}
POSTGRES_USER: ${DB_USER:?must-specify-db-user}
PGUSER: ${DB_USER:?must-specify-db-user}
POSTGRES_PASSWORD: ${DB_PASSWORD:?must-specify-db-password}
POSTGRES_HOST_AUTH_METHOD: md5
POSTGRES_INITDB_ARGS: "--auth-host=md5 --auth-local=md5"
env_file:
- ${RC_ENV_FILE:?must-specify-rc-env-file}
restart: always
command:
- "postgres"
- "-c"
- "log_statement=ddl"
- "-c"
- "config_file=/etc/conf.d/pg_customized.conf"
# ports:
# - "127.0.0.1::5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready", '-U', "$DB_USER"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- $PWD/config/database/pg_customized.conf:/etc/conf.d/pg_customized.conf:ro
# db dumps reverse mount
- $PWD/.custom/db_dump:/var/rc-data-dump
# save the pg_data volume
- pg_data:/var/lib/postgresql/data
profiles:
["postgres", "database"]
logging:
*custom-logging
database-mysql:
networks:
- rhodecode_network
image: library/mysql:8.0.37
environment:
MYSQL_DATABASE: ${DB_NAME:?must-specify-db-name}
MYSQL_USER: ${DB_USER:?must-specify-db-user}
MYSQL_PASSWORD: ${DB_PASSWORD:?must-specify-db-password}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:?must-specify-db-password}
env_file:
- ${RC_ENV_FILE:?must-specify-rc-env-file}
restart: always
# ports:
# - "127.0.0.1::3306"
volumes:
- $PWD/config/database/mysql_customized.conf:/etc/mysql/conf.d/config-file.cnf:ro
# db dumps reverse mount
- $PWD/.custom/db_dump:/var/rc-data-dump
# save the mysql_data volume
- mysql_data:/var/lib/mysql
profiles:
["mysql"]
logging:
*custom-logging
# DEBUG/DEVEL
httpbin:
networks:
- rhodecode_network
image: kennethreitz/httpbin:latest
ports:
# expose on 9090 to not block 80 for traefik
- "9090:80"
profiles:
["testing"]
restart: always
ldap-server:
networks:
- rhodecode_network
image: rroemhild/test-openldap:latest
ports:
# expose on 10389 (ldap) 10636 (ldaps)
- "10389:10389"
- "10636:10636"
profiles:
["testing"]
restart: always
s3-minio:
networks:
- rhodecode_network
image: minio/minio:latest
ports:
# expose on 9000 (API) 9001 (console)
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: s3admin
MINIO_ROOT_PASSWORD: s3secret4
MINIO_API_ROOT_ACCESS: true
MINIO_DOMAIN: "${RC_HOSTNAME}"
volumes:
# db dumps reverse mount
- $PWD/.custom/s3fs:/data
profiles:
["testing"]
command: server --console-address ":9001" /data
restart: always