Skip to content

Commit

Permalink
zabbix
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaofeng1227 committed Sep 26, 2024
1 parent 9e7ce5e commit 073483e
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 19 deletions.
7 changes: 1 addition & 6 deletions apps/immich/.env
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
W9_VERSION=release
W9_DIST=community

W9_REPO=ghcr.io/immich-app/immich-server
W9_POWER_PASSWORD=uQ8E1wVTzHH8SOk3!

#### -- Not allowed to edit below environments when recreate app based on existing data -- ####
W9_ID=immich
W9_HTTP_PORT=3001
W9_HTTP_PORT_SET=9001

W9_DB_EXPOSE="postgresql"

W9_URL=appname.example.com
W9_NETWORK=websoft9
#### --------------------------------------------------------------------------------------- ####

## --------environmnet from immich -----------
UPLOAD_LOCATION=./library
DB_DATA_LOCATION=./postgres
# TZ=Etc/UTC

DB_DATABASE_NAME=immich
DB_USERNAME=immich
DB_PASSWORD=$W9_POWER_PASSWORD
21 changes: 10 additions & 11 deletions apps/immich/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ version: '3.8'
services:
immich-server:
container_name: $W9_ID
image: ghcr.io/immich-app/immich-server:${W9_VERSION:-release}
image: $W9_REPO:$W9_VERSION
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- upload_data:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
Expand All @@ -17,18 +17,16 @@ services:
depends_on:
- redis
- database
restart: always
restart: unless-stopped
healthcheck:
disable: false

immich-machine-learning:
container_name: $W9_ID-ml
image: ghcr.io/immich-app/immich-machine-learning:${W9_VERSION:-release}
image: ghcr.io/immich-app/immich-machine-learning:$W9_VERSION
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
restart: unless-stopped
healthcheck:
disable: false

Expand All @@ -37,7 +35,7 @@ services:
image: docker.io/redis:6.2-alpine@sha256:2d1463258f2764328496376f5d965f20c6a67f66ea2b06dc42af351f75248792
healthcheck:
test: redis-cli ping || exit 1
restart: always
restart: unless-stopped

database:
container_name: $W9_ID-postgres
Expand All @@ -48,18 +46,19 @@ services:
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: '--data-checksums'
volumes:
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
- postgresql_data:/var/lib/postgresql/data
healthcheck:
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
interval: 5m
start_interval: 30s
start_period: 5m
command: [ "postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on" ]
restart: always
restart: unless-stopped

volumes:
model-cache:

postgresql_data:
upload_data:

networks:
default:
Expand Down
15 changes: 14 additions & 1 deletion apps/zabbix/.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,17 @@ W9_NETWORK=websoft9

POSTGRES_DB=zabbix
POSTGRES_USER=zabbix
POSTGRES_PASSWORD=$W9_POWER_PASSWORD
POSTGRES_PASSWORD=$W9_POWER_PASSWORD

# env for java gateway
# ZBX_START_POLLERS=5
# ZBX_TIMEOUT=3
## Possible values: trace, debug, info, want, error, all, off
# ZBX_DEBUGLEVEL=info

# env for snmptraps
# ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z
# ZBX_SNMP_TRAP_FORMAT=\n
# # To use DNS instead of sender IP override container's command: /usr/sbin/snmptrapd -C -c /etc/snmp/snmptrapd.conf -Lo -A
# # Need to remove "-n" command argument
# ZBX_SNMP_TRAP_USE_DNS=false
43 changes: 42 additions & 1 deletion apps/zabbix/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,54 @@ services:
depends_on:
- zabbix-server

zabbix-java-gateway:
image: zabbix/zabbix-java-gateway:$W9_VERSION
container_name: $W9_ID-javagateway
ports:
- 10052:10052
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
stop_grace_period: 5s
profiles:
- full

snmptraps:
image: zabbix/zabbix-snmptraps:$W9_VERSION
container_name: $W9_ID-snmptraps
ports:
- 1162:1162
restart: unless-stopped
attach: false
read_only: true
volumes:
- zabbix-snmptraps:/var/lib/zabbix/snmptraps:rwz
tmpfs: /tmp
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
stop_grace_period: 5s
profiles:
- full

volumes:
postgres-data:
zabbix-server-data:
zabbix-snmptraps-data:
zabbix-export-data:
zabbix-web-data:

zabbix-snmptraps:

networks:
default:
Expand Down

0 comments on commit 073483e

Please sign in to comment.