docker-compose.yml 1.3 KB

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