docker-compose.yml 1.5 KB

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