docker-compose.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. - ./backend/config:/opt/app/config
  11. - ./@musare_types:/opt/@musare_types
  12. environment:
  13. - CONTAINER_MODE=${CONTAINER_MODE:-prod}
  14. links:
  15. - mongo
  16. - redis
  17. stdin_open: true
  18. tty: true
  19. frontend:
  20. build:
  21. context: ./frontend
  22. target: musare_frontend
  23. args:
  24. FRONTEND_MODE: "${FRONTEND_MODE:-prod}"
  25. restart: ${RESTART_POLICY:-unless-stopped}
  26. user: root
  27. ports:
  28. - "${FRONTEND_HOST:-0.0.0.0}:${FRONTEND_PORT:-80}:80"
  29. volumes:
  30. - ./.git:/opt/app/.parent_git:ro
  31. - ./frontend/dist/config:/opt/app/dist/config
  32. - ./@musare_types:/opt/@musare_types
  33. environment:
  34. - FRONTEND_MODE=${FRONTEND_MODE:-prod}
  35. - CONTAINER_MODE=${CONTAINER_MODE:-prod}
  36. links:
  37. - backend
  38. mongo:
  39. image: docker.io/mongo:${MONGO_VERSION}
  40. restart: ${RESTART_POLICY:-unless-stopped}
  41. environment:
  42. - MONGO_INITDB_ROOT_USERNAME=admin
  43. - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  44. - MONGO_INITDB_DATABASE=musare
  45. - MONGO_PORT=${MONGO_PORT:-27017}
  46. - MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  47. - MONGO_USER_USERNAME=${MONGO_USER_USERNAME}
  48. - MONGO_USER_PASSWORD=${MONGO_USER_PASSWORD}
  49. volumes:
  50. - ./tools/docker/setup-mongo.sh:/docker-entrypoint-initdb.d/setup-mongo.sh
  51. - ${MONGO_DATA_LOCATION:-./db}:/data/db
  52. redis:
  53. image: docker.io/redis:6.2
  54. restart: ${RESTART_POLICY:-unless-stopped}
  55. command: "--notify-keyspace-events Ex --requirepass ${REDIS_PASSWORD} --appendonly yes"
  56. volumes:
  57. - /data