b55e5e4577
- Add clamav - Use nlss/mariadb - Add healthchecks - Overall improvements
147 lines
3.6 KiB
YAML
147 lines
3.6 KiB
YAML
version: "3"
|
|
services:
|
|
|
|
nginx:
|
|
image: nginx:mainline-alpine
|
|
links:
|
|
- service
|
|
depends_on:
|
|
- service
|
|
volumes:
|
|
- ./src/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- static_assets:/opt/postal/public:ro
|
|
- assets:/opt/postal/public/assets:ro
|
|
networks:
|
|
default: {aliases: [ postal_nginx, nginx ]}
|
|
http:
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: [ "CMD", "curl", "--fail", "http://127.0.0.1" ]
|
|
interval: 15s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
service:
|
|
image: catdeployed/postal:alpine
|
|
build:
|
|
context: .
|
|
command: run
|
|
depends_on:
|
|
- systemdb
|
|
- messagedb
|
|
- queue
|
|
- clamav
|
|
volumes:
|
|
- storage:/storage
|
|
- static_assets:/opt/postal/public
|
|
- assets:/opt/postal/public/assets
|
|
- ./src/templates/:/templates
|
|
environment:
|
|
- CLAMAV_HOST=clamav
|
|
- CLAMAV_PORT=3310
|
|
- SYSTEMDB_HOST=systemdb
|
|
- SYSTEMDB_DATABASE=postal
|
|
- SYSTEMDB_USER=root
|
|
- SYSTEMDB_PASSWORD=SQtDHUD7spitQQvoQ^2vSCTZBg5nX^
|
|
- MESSAGEDB_HOST=messagedb
|
|
- MESSAGEDB_DATABASE=messages
|
|
- MESSAGEDB_USER=root
|
|
- MESSAGEDB_PASSWORD=SQtDHUD7spitQQvoQ^2vSCTZBg5nX^
|
|
- RABBITMQ_DEFAULT_USER=postal
|
|
- RABBITMQ_DEFAULT_PASS=changeme
|
|
- RABBITMQ_DEFAULT_VHOST=postal
|
|
- POSTAL_FNAME=Sia
|
|
- POSTAL_LNAME=Cat
|
|
- POSTAL_PASSWORD=hDzqLsP5hEXuBinpQ3KHSknvgTxRu6
|
|
- POSTAL_EMAIL=aleksandar@puharic.com
|
|
networks:
|
|
default: { aliases: [ postal, service ] }
|
|
client: { aliases: [ postal, mailer, mailer-service ] }
|
|
healthcheck:
|
|
test: curl -sS http://127.0.0.1:5000 || exit 1
|
|
interval: 5s
|
|
timeout: 10s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
systemdb:
|
|
image: nlss/mariadb
|
|
volumes:
|
|
- systemdb_data:/var/lib/mysql
|
|
- systemdb_backup:/var/lib/backup
|
|
- systemdb_log:/var/log/mysql
|
|
environment:
|
|
- MARIADB_ROOT_PASSWORD=SQtDHUD7spitQQvoQ^2vSCTZBg5nX^
|
|
- MARIADB_DATABASE=postal
|
|
networks:
|
|
default: { aliases: [ postal_mysql, mysql, mariadb, database ] }
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: [ "CMD", "/usr/bin/healthcheck" ]
|
|
interval: 30s
|
|
timeout: 20s
|
|
retries: 3
|
|
|
|
messagedb:
|
|
image: nlss/mariadb
|
|
volumes:
|
|
- messagedb_data:/var/lib/mysql
|
|
- messagedb_backup:/var/lib/backup
|
|
- messagedb_log:/var/log/mysql
|
|
environment:
|
|
- MARIADB_ROOT_PASSWORD=SQtDHUD7spitQQvoQ^2vSCTZBg5nX^
|
|
- MARIADB_DATABASE=messages
|
|
networks:
|
|
default: { aliases: [ postal_mysql, mysql, mariadb, database ] }
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: [ "CMD", "/usr/bin/healthcheck" ]
|
|
interval: 30s
|
|
timeout: 20s
|
|
retries: 3
|
|
|
|
queue:
|
|
image: rabbitmq:3-alpine
|
|
environment:
|
|
- RABBITMQ_DEFAULT_USER=postal
|
|
- RABBITMQ_DEFAULT_PASS=changeme
|
|
- RABBITMQ_DEFAULT_VHOST=/postal
|
|
networks:
|
|
default: { aliases: [ postal_rabbitmq, rabbitmq, queue ] }
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: rabbitmq-diagnostics -q ping
|
|
interval: 30s
|
|
timeout: 30s
|
|
retries: 3
|
|
|
|
clamav:
|
|
image: mkodockx/docker-clamav:alpine
|
|
volumes:
|
|
- clamav_data:/var/lib/clamav
|
|
networks:
|
|
default: { aliases: [ clamav ] }
|
|
healthcheck:
|
|
test: [ "CMD", "./check.sh" ]
|
|
interval: 60s
|
|
retries: 3
|
|
start_period: 120s
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
default:
|
|
client:
|
|
http:
|
|
|
|
volumes:
|
|
static_assets:
|
|
assets:
|
|
clamav_data:
|
|
systemdb_data:
|
|
systemdb_backup:
|
|
systemdb_log:
|
|
messagedb_data:
|
|
messagedb_backup:
|
|
messagedb_log:
|
|
storage:
|