docker-compose.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. version: "3.8"
  2. services:
  3. backend:
  4. build:
  5. context: ./backend
  6. target: musare_backend
  7. restart: ${RESTART_POLICY:-unless-stopped}
  8. volumes:
  9. - ./.git:/opt/app/.parent_git:ro
  10. - /opt/app/node_modules
  11. - ./backend/config:/opt/app/config
  12. links:
  13. - mongo
  14. - redis
  15. stdin_open: true
  16. tty: true
  17. frontend:
  18. build:
  19. context: ./frontend
  20. target: musare_frontend
  21. args:
  22. FRONTEND_MODE: "${FRONTEND_MODE:-prod}"
  23. restart: ${RESTART_POLICY:-unless-stopped}
  24. ports:
  25. - "${FRONTEND_HOST:-0.0.0.0}:${FRONTEND_PORT:-80}:80"
  26. volumes:
  27. - ./.git:/opt/app/.parent_git:ro
  28. - /opt/app/node_modules
  29. - ./frontend/dist/config:/opt/app/dist/config
  30. environment:
  31. - FRONTEND_MODE=${FRONTEND_MODE:-prod}
  32. links:
  33. - backend
  34. mongo:
  35. image: docker.io/mongo:${MONGO_VERSION}
  36. restart: ${RESTART_POLICY:-unless-stopped}
  37. environment:
  38. - MONGO_INITDB_ROOT_USERNAME=admin
  39. - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  40. - MONGO_INITDB_DATABASE=musare
  41. - MONGO_PORT=${MONGO_PORT:-27017}
  42. - MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  43. - MONGO_USER_USERNAME=${MONGO_USER_USERNAME}
  44. - MONGO_USER_PASSWORD=${MONGO_USER_PASSWORD}
  45. volumes:
  46. - ./tools/docker/setup-mongo.sh:/docker-entrypoint-initdb.d/setup-mongo.sh
  47. - ${MONGO_DATA_LOCATION:-./db}:/data/db
  48. redis:
  49. image: docker.io/redis:6.2
  50. restart: ${RESTART_POLICY:-unless-stopped}
  51. command: "--notify-keyspace-events Ex --requirepass ${REDIS_PASSWORD} --appendonly yes"
  52. volumes:
  53. - /data