docker-compose.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. links:
  11. - mongo
  12. - redis
  13. stdin_open: true
  14. tty: true
  15. frontend:
  16. build: ./frontend
  17. ports:
  18. - "${FRONTEND_HOST}:${FRONTEND_PORT}:80"
  19. volumes:
  20. - ./frontend:/opt/app
  21. - /opt/app/node_modules/
  22. environment:
  23. - FRONTEND_MODE=${FRONTEND_MODE}
  24. links:
  25. - backend
  26. mongo:
  27. image: mongo:4.0
  28. ports:
  29. - "${MONGO_HOST}:${MONGO_PORT}:${MONGO_PORT}"
  30. environment:
  31. - MONGO_INITDB_ROOT_USERNAME=admin
  32. - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  33. - MONGO_INITDB_DATABASE=musare
  34. - MONGO_PORT=${MONGO_PORT}
  35. - MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  36. - MONGO_USER_USERNAME=${MONGO_USER_USERNAME}
  37. - MONGO_USER_PASSWORD=${MONGO_USER_PASSWORD}
  38. volumes:
  39. - ./tools/docker/setup-mongo.sh:/docker-entrypoint-initdb.d/setup-mongo.sh
  40. - ./.db:/data/db
  41. redis:
  42. image: redis
  43. ports:
  44. - "${REDIS_HOST}:${REDIS_PORT}:6379"
  45. command: "--notify-keyspace-events Ex --requirepass ${REDIS_PASSWORD} --appendonly yes"
  46. volumes:
  47. - .redis:/data