docker-compose.yml 3.9 KB

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