docker-compose.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. version: "3.8"
  2. services:
  3. backend:
  4. build:
  5. context: .
  6. dockerfile: ./backend/Dockerfile
  7. target: musare_backend
  8. args:
  9. BACKEND_MODE: "${BACKEND_MODE:-production}"
  10. restart: ${RESTART_POLICY:-unless-stopped}
  11. volumes:
  12. - ./backend/config:/opt/app/config
  13. environment:
  14. - BACKEND_MODE=${BACKEND_MODE:-production}
  15. - CONTAINER_MODE=${CONTAINER_MODE:-production}
  16. - MUSARE_SITENAME=${MUSARE_SITENAME:-Musare}
  17. - MUSARE_PRIMARY_COLOR=${MUSARE_PRIMARY_COLOR:-#03a9f4}
  18. - MUSARE_DEBUG_VERSION=${MUSARE_DEBUG_VERSION:-true}
  19. - MUSARE_DEBUG_GIT_REMOTE=${MUSARE_DEBUG_GIT_REMOTE:-false}
  20. - MUSARE_DEBUG_GIT_REMOTE_URL=${MUSARE_DEBUG_GIT_REMOTE_URL:-false}
  21. - MUSARE_DEBUG_GIT_BRANCH=${MUSARE_DEBUG_GIT_BRANCH:-true}
  22. - MUSARE_DEBUG_GIT_LATEST_COMMIT=${MUSARE_DEBUG_GIT_LATEST_COMMIT:-true}
  23. - MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT=${MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT:-true}
  24. - MONGO_USER_USERNAME=${MONGO_USER_USERNAME}
  25. - MONGO_USER_PASSWORD=${MONGO_USER_PASSWORD}
  26. - REDIS_PASSWORD=${REDIS_PASSWORD}
  27. links:
  28. - mongo
  29. - redis
  30. stdin_open: true
  31. tty: true
  32. logging:
  33. driver: "json-file"
  34. options:
  35. max-size: "1m"
  36. max-file: "3"
  37. frontend:
  38. build:
  39. context: .
  40. dockerfile: ./frontend/Dockerfile
  41. target: musare_frontend
  42. args:
  43. FRONTEND_MODE: "${FRONTEND_MODE:-production}"
  44. FRONTEND_PROD_DEVTOOLS: "${FRONTEND_PROD_DEVTOOLS:-false}"
  45. MUSARE_SITENAME: "${MUSARE_SITENAME:-Musare}"
  46. MUSARE_PRIMARY_COLOR: "${MUSARE_PRIMARY_COLOR:-#03a9f4}"
  47. MUSARE_DEBUG_VERSION: "${MUSARE_DEBUG_VERSION:-true}"
  48. MUSARE_DEBUG_GIT_REMOTE: "${MUSARE_DEBUG_GIT_REMOTE:-false}"
  49. MUSARE_DEBUG_GIT_REMOTE_URL: "${MUSARE_DEBUG_GIT_REMOTE_URL:-false}"
  50. MUSARE_DEBUG_GIT_BRANCH: ${MUSARE_DEBUG_GIT_BRANCH:-true}
  51. MUSARE_DEBUG_GIT_LATEST_COMMIT: "${MUSARE_DEBUG_GIT_LATEST_COMMIT:-true}"
  52. MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT: "${MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT:-true}"
  53. restart: ${RESTART_POLICY:-unless-stopped}
  54. user: root
  55. ports:
  56. - "${FRONTEND_HOST:-0.0.0.0}:${FRONTEND_PORT:-80}:80"
  57. environment:
  58. - CONTAINER_MODE=${CONTAINER_MODE:-production}
  59. - FRONTEND_MODE=${FRONTEND_MODE:-production}
  60. - FRONTEND_PORT=${FRONTEND_PORT:-80}
  61. - FRONTEND_CLIENT_PORT=${FRONTEND_CLIENT_PORT:-80}
  62. - FRONTEND_DEV_PORT=${FRONTEND_DEV_PORT:-81}
  63. - FRONTEND_PROD_DEVTOOLS=${FRONTEND_PROD_DEVTOOLS:-false}
  64. - MUSARE_SITENAME=${MUSARE_SITENAME:-Musare}
  65. - MUSARE_PRIMARY_COLOR=${MUSARE_PRIMARY_COLOR:-#03a9f4}
  66. - MUSARE_DEBUG_VERSION=${MUSARE_DEBUG_VERSION:-true}
  67. - MUSARE_DEBUG_GIT_REMOTE=${MUSARE_DEBUG_GIT_REMOTE:-false}
  68. - MUSARE_DEBUG_GIT_REMOTE_URL=${MUSARE_DEBUG_GIT_REMOTE_URL:-false}
  69. - MUSARE_DEBUG_GIT_BRANCH=${MUSARE_DEBUG_GIT_BRANCH:-true}
  70. - MUSARE_DEBUG_GIT_LATEST_COMMIT=${MUSARE_DEBUG_GIT_LATEST_COMMIT:-true}
  71. - MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT=${MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT:-true}
  72. links:
  73. - backend
  74. logging:
  75. driver: "json-file"
  76. options:
  77. max-size: "1m"
  78. max-file: "3"
  79. mongo:
  80. image: docker.io/mongo:${MONGO_VERSION}
  81. restart: ${RESTART_POLICY:-unless-stopped}
  82. environment:
  83. - MONGO_INITDB_ROOT_USERNAME=admin
  84. - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  85. - MONGO_INITDB_DATABASE=musare
  86. - MONGO_PORT=${MONGO_PORT:-27017}
  87. - MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  88. - MONGO_USER_USERNAME=${MONGO_USER_USERNAME}
  89. - MONGO_USER_PASSWORD=${MONGO_USER_PASSWORD}
  90. volumes:
  91. - ./tools/docker/setup-mongo.sh:/docker-entrypoint-initdb.d/setup-mongo.sh
  92. - ${MONGO_DATA_LOCATION:-./db}:/data/db
  93. logging:
  94. driver: "json-file"
  95. options:
  96. max-size: "1m"
  97. max-file: "3"
  98. redis:
  99. image: docker.io/redis:7
  100. restart: ${RESTART_POLICY:-unless-stopped}
  101. command: "--notify-keyspace-events Ex --requirepass ${REDIS_PASSWORD} --appendonly yes"
  102. volumes:
  103. - /data
  104. logging:
  105. driver: "json-file"
  106. options:
  107. max-size: "1m"
  108. max-file: "3"