docker-compose.yml 1.4 KB

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