SamR1 / docker-fittrackee

GNU General Public License v3.0
13 stars 0 forks source link

[Guide] Deployment on Synology NAS #32

Closed Mickey016 closed 7 months ago

Mickey016 commented 7 months ago

Hi,

after some tinkering, I managed to run Fittrackee on my Synology (DS1019+ but should be the same for every x86 model).

Here are the steps I followed :

# Custom variables initialisation
# All uncommented variables must be initialized

# Host directory to store FitTrackee logs (must be an absolute path)
FITTRACKEE_LOG_DIR=/logs

# Application
# directories are located in the docker container
FLASK_APP=fittrackee
FLASK_SKIP_DOTENV=1
PORT=5000
APP_SETTINGS=fittrackee.config.ProductionConfig
APP_SECRET_KEY='please change me'
APP_LOG=/logs/fittrackee.log
UPLOAD_FOLDER=/uploads  # must match docker-compose config
# gunicorn settings
# see https://docs.gunicorn.org/en/stable/settings.html#worker-processes
APP_WORKERS=2
GUNICORN_LOG=/logs/gunicorn.log
GUNICORN_TIMEOUT=300
GUNICORN_THREADS=4
# workers settings
WORKERS_PROCESSES=2

# PostgreSQL
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
# fittrackee user password must match the password in database creation script (db/create.sql)
DATABASE_URL=postgresql://fittrackee:fittrackee@fittrackee-db:5432/fittrackee
#DATABASE_DISABLE_POOLING=

# Redis (required for API rate limits, email sending and user export)
#REDIS_URL=redis://redis:6379

# API rate limits (needs redis running)
#API_RATE_LIMITS="300 per 5 minutes"

# Emails
# since fittrackee 0.6.5, email sending can be disabled
# see documentation https://samr1.github.io/FitTrackee/installation.html#emails
#UI_URL=
#EMAIL_URL=
#SENDER_EMAIL=

# Workouts
#export TILE_SERVER_URL=
#export STATICMAP_SUBDOMAINS=
#export MAP_ATTRIBUTION=
#export DEFAULT_STATICMAP=False

# Weather
# available weather API providers: darksky, visualcrossing
#export WEATHER_API_PROVIDER=
#export WEATHER_API_KEY=

services:

fittrackee-db: container_name: fittrackee-db build: ./db env_file:

volumes: fittrackee_upload:


- because the command 'make' is not available on DSM, we have to use the complete command lines as root (use "sudo -i" if needed): 

docker-compose build

docker-compose up -d

docker-compose exec fittrackee scripts/migrate.sh

docker-compose exec fittrackee supervisorctl start all


Your Fittrackee instance should be available at http://IP-of-your-NAS:5000 (or whatever port you specified in docker-compose.yml).

Register on the homepage and then use this last command to activate the admin account :

docker-compose exec fittrackee scripts/set-admin.sh YOURUSERNAME



Hope this could help some of you and keep up the good work @SamR1 !