Skip to content

Instantly share code, notes, and snippets.

@sanghviharshit
Created March 14, 2022 01:49
Show Gist options
  • Save sanghviharshit/5cd0122d4e394ad6cce62e0af687f42f to your computer and use it in GitHub Desktop.
Save sanghviharshit/5cd0122d4e394ad6cce62e0af687f42f to your computer and use it in GitHub Desktop.
My docker-compose.yml config file for bunch of applications running on my Synology NAS
# - Run 'docker-compose pull'.
# - Run 'docker-compose up -d'.
# - To stop running containers from this compose file - Run docker-compose down
# The env variables are set in .env file in the same directory
version: "3.4"
services:
postgresdb:
image: postgres:13
restart: unless-stopped
container_name: postgresdb
# network_mode: bridge
volumes:
- /volume1/docker/postgres/database:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${POSTGRES_DB_GENERAL}
POSTGRES_USER: ${POSTGRES_UNAME_POSTGRES}
POSTGRES_PASSWORD: ${POSTGRES_PW_POSTGRES}
ports:
- 5431:5432
teslamate_grafana:
image: teslamate/grafana:latest
container_name: teslamate_grafana
# network_mode: bridge
restart: unless-stopped
depends_on:
- postgresdb
environment:
- DATABASE_USER=${POSTGRES_UNAME_POSTGRES}
- DATABASE_PASS=${POSTGRES_PW_POSTGRES}
- DATABASE_NAME=${POSTGRES_DB_GENERAL}
- DATABASE_HOST=postgresdb
ports:
- 3010:3000
user: "1029" # See https://grafana.com/docs/grafana/latest/installation/docker/ if you run into any issues after upgrade. Might require sudo chown -R docker:docker teslamate/grafana
volumes:
- /volume1/docker/teslamate/grafana:/var/lib/grafana
teslamate:
image: teslamate/teslamate:latest
container_name: teslamate
restart: unless-stopped
depends_on:
- postgresdb
environment:
- DATABASE_USER=${POSTGRES_UNAME_POSTGRES}
- DATABASE_PASS=${POSTGRES_PW_POSTGRES}
- DATABASE_NAME=${POSTGRES_DB_GENERAL}
- DATABASE_HOST=postgresdb
- MQTT_HOST=192.168.5.100
- MQTT_USERNAME=harshit
- MQTT_PASSWORD=NotFound
ports:
- 4000:4000
volumes:
- /volume1/docker/teslamate/import:/opt/app/import
cap_drop:
- all
mosquitto:
image: eclipse-mosquitto:latest
restart: unless-stopped
container_name: mosquitto
# command: mosquitto -c /mosquitto/config/mosquitto.conf
ports:
- 1883:1883
volumes:
- /volume1/docker/mosquitto/config:/mosquitto/config
- /volume1/docker/mosquitto/data:/mosquitto/data
influxdb:
image: influxdb:latest
# network_mode: bridge
container_name: influxdb2
restart: unless-stopped
volumes:
- /volume1/docker/influxdb/data:/var/lib/influxdb2
- /volume1/docker/influxdb/config:/etc/influxdb2
ports:
- 8086:8086
homebridge:
image: oznu/homebridge:latest
container_name: homebridge
network_mode: host
restart: unless-stopped
volumes:
- /volume1/docker/homebridge:/homebridge
environment:
- DSM_HOSTNAME=DSM
scrypted:
image: koush/scrypted
container_name: scrypted
restart: unless-stopped
network_mode: host
volumes:
- /volume1/docker/scrypted/volume:/server/volume
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
# https://digitalboxweb.wordpress.com/2020/02/01/redis-sur-nas-synology/
redis:
image: redis:latest
container_name: redis
network_mode: bridge
restart: unless-stopped
volumes:
- /volume1/docker/redis:/usr/local/etc/redis
ports:
- 6379:6379
watchtower:
image: containrrr/watchtower
container_name: watchtower
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# command: --interval 30 # Seconds
motioneye:
container_name: motioneye
network_mode: 'bridge'
restart: unless-stopped
ports:
- 8765:8765
- 8081:8081
image: ccrisan/motioneye:master-amd64
hostname: motioneye
volumes:
- /volume1/docker/motioneye/conf:/etc/motioneye
- /volume1/docker/motioneye/data:/var/lib/motioneye
- /etc/localtime:/etc/localtime:ro
environment:
- TZ='America/Los_Angeles'
- PUID=1029
- PGID=100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment