Skip to content

Instantly share code, notes, and snippets.

@luckman212
Last active September 3, 2023 01:27
Show Gist options
  • Save luckman212/40ff0a827c12007c8c79ff275d390767 to your computer and use it in GitHub Desktop.
Save luckman212/40ff0a827c12007c8c79ff275d390767 to your computer and use it in GitHub Desktop.
docker-compose config for speedtest-tracker + MariaDB on Synology
# place in same dir as compose.yml, adjust as needed for your environment
# create a limited user and run `id <username>` to get the PUID/PGID values
TZ=America/New_York
CNAME=speedtest
DOCKER_DIR=/volume1/docker
PUID=1030
PGID=100
MARIADB_DATABASE=speedtest-tracker
MARIADB_USER=speedy
MARIADB_PASSWORD=password
# change 'prod' network to whatever your actual network name is!
# make sure to create and adjust the .env file below as well
version: '3.3'
services:
speedtest-tracker:
image: 'ghcr.io/alexjustesen/speedtest-tracker:latest'
container_name: ${CNAME}_cfg
restart: unless-stopped
depends_on:
- db
ports:
- '8080:80'
- '8443:443'
networks:
- prod
environment:
- PUID=${PUID}
- PGID=${PGID}
- DB_CONNECTION=mysql
- DB_HOST=${CNAME}_db
- DB_PORT=3306
- DB_DATABASE=${MARIADB_DATABASE}
- DB_USERNAME=${MARIADB_USER}
- DB_PASSWORD=${MARIADB_PASSWORD}
- TZ=${TZ}
volumes:
- type: bind
source: /etc/localtime
target: /etc/localtime
read_only: true
bind:
create_host_path: true
- type: bind
source: ${DOCKER_DIR}/${CNAME}/cfg
target: /config
bind:
create_host_path: true #may not work on Synology - if you get errors, create the path manually
db:
image: mariadb:latest
container_name: ${CNAME}_db
restart: always
networks:
- prod
environment:
- MARIADB_DATABASE=${MARIADB_DATABASE}
- MARIADB_USER=${MARIADB_USER}
- MARIADB_PASSWORD=${MARIADB_PASSWORD}
- MARIADB_RANDOM_ROOT_PASSWORD=true
volumes:
- type: bind
source: ${DOCKER_DIR}/${CNAME}/db
target: /var/lib/mysql
bind:
create_host_path: true
networks:
prod:
external: true
@luckman212
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment