From 8dcae2456bfe3d9b8cab9295f57abd6ec0871f17 Mon Sep 17 00:00:00 2001 From: Chigozirim Igweamaka Date: Wed, 19 Nov 2025 16:40:37 +0100 Subject: [PATCH] chore(docker-compose): update compose config. --- docker-compose.yml | 71 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9601c8f..5dc779a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,15 +1,21 @@ -version: '3.1' +version: '3.8' volumes: seek-tune-db: + driver: local seek-tune-songs: + driver: local + seek-tune-recordings: + driver: local services: seek-tune: - image: 'seek-tune' + image: seek-tune:latest + container_name: seek-tune-app restart: unless-stopped + ports: - - 8080:5000 + - "${HOST_PORT:-8080}:5000" environment: DB_TYPE: ${DB_TYPE:-sqlite} @@ -18,14 +24,67 @@ services: DB_NAME: ${DB_NAME:-seek_tune_db} DB_HOST: ${DB_HOST:-localhost} DB_PORT: ${DB_PORT:-27017} - + + ENV: production REACT_APP_BACKEND_URL: ${REACT_APP_BACKEND_URL:-http://localhost:8080} + + SPOTIFY_CLIENT_ID: ${SPOTIFY_CLIENT_ID:-} + SPOTIFY_CLIENT_SECRET: ${SPOTIFY_CLIENT_SECRET:-} build: context: . + dockerfile: Dockerfile args: REACT_APP_BACKEND_URL: ${REACT_APP_BACKEND_URL:-http://localhost:8080} + cache_from: + - seek-tune:latest volumes: - - seek-tune-db:/home/seek-tune/db - - seek-tune-songs:/home/seek-tune/songs \ No newline at end of file + - seek-tune-db:/app/db + - seek-tune-songs:/app/songs + - seek-tune-recordings:/app/recordings + # Optional: Mount local songs directory for development + # - ./server/songs:/app/songs + + # Resource limits (adjust based on your needs) + deploy: + resources: + limits: + cpus: '2.0' + memory: 2G + reservations: + cpus: '0.5' + memory: 512M + + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:5000/"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s + + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + + # Optional: MongoDB service (if using MongoDB instead of SQLite) + # mongodb: + # image: mongo:7 + # container_name: seek-tune-mongo + # restart: unless-stopped + # environment: + # MONGO_INITDB_ROOT_USERNAME: ${DB_USER:-root} + # MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD:-password} + # MONGO_INITDB_DATABASE: ${DB_NAME:-seek_tune_db} + # ports: + # - "27017:27017" + # volumes: + # - seek-tune-db:/data/db + # healthcheck: + # test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet + # interval: 10s + # timeout: 10s + # retries: 5 + # start_period: 40s