docker-compose.yml 3.6 KB

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