docker-compose.yml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. - ./.git:/opt/app/.git:ro
  11. - ./backend/config:/opt/app/config
  12. - ./types:/opt/types
  13. environment:
  14. - CONTAINER_MODE=${CONTAINER_MODE:-production}
  15. - MUSARE_SITENAME=${MUSARE_SITENAME:-Musare}
  16. - MUSARE_DEBUG_VERSION=${MUSARE_DEBUG_VERSION:-true}
  17. - MUSARE_DEBUG_GIT_REMOTE=${MUSARE_DEBUG_GIT_REMOTE:-false}
  18. - MUSARE_DEBUG_GIT_REMOTE_URL=${MUSARE_DEBUG_GIT_REMOTE_URL:-false}
  19. - MUSARE_DEBUG_GIT_BRANCH=${MUSARE_DEBUG_GIT_BRANCH:-true}
  20. - MUSARE_DEBUG_GIT_LATEST_COMMIT=${MUSARE_DEBUG_GIT_LATEST_COMMIT:-true}
  21. - MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT=${MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT:-true}
  22. links:
  23. - mongo
  24. - redis
  25. stdin_open: true
  26. tty: true
  27. frontend:
  28. build:
  29. context: .
  30. dockerfile: ./frontend/Dockerfile
  31. target: musare_frontend
  32. args:
  33. FRONTEND_MODE: "${FRONTEND_MODE:-production}"
  34. FRONTEND_PROD_DEVTOOLS: "${FRONTEND_PROD_DEVTOOLS:-false}"
  35. MUSARE_SITENAME: "${MUSARE_SITENAME:-Musare}"
  36. MUSARE_DEBUG_VERSION: "${MUSARE_DEBUG_VERSION:-true}"
  37. MUSARE_DEBUG_GIT_REMOTE: "${MUSARE_DEBUG_GIT_REMOTE:-false}"
  38. MUSARE_DEBUG_GIT_REMOTE_URL: "${MUSARE_DEBUG_GIT_REMOTE_URL:-false}"
  39. MUSARE_DEBUG_GIT_BRANCH: ${MUSARE_DEBUG_GIT_BRANCH:-true}
  40. MUSARE_DEBUG_GIT_LATEST_COMMIT: "${MUSARE_DEBUG_GIT_LATEST_COMMIT:-true}"
  41. MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT: "${MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT:-true}"
  42. restart: ${RESTART_POLICY:-unless-stopped}
  43. user: root
  44. ports:
  45. - "${FRONTEND_HOST:-0.0.0.0}:${FRONTEND_PORT:-80}:80"
  46. volumes:
  47. - ./.git:/opt/app/.git:ro
  48. - ./types:/opt/types
  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_DEBUG_VERSION=${MUSARE_DEBUG_VERSION:-true}
  58. - MUSARE_DEBUG_GIT_REMOTE=${MUSARE_DEBUG_GIT_REMOTE:-false}
  59. - MUSARE_DEBUG_GIT_REMOTE_URL=${MUSARE_DEBUG_GIT_REMOTE_URL:-false}
  60. - MUSARE_DEBUG_GIT_BRANCH=${MUSARE_DEBUG_GIT_BRANCH:-true}
  61. - MUSARE_DEBUG_GIT_LATEST_COMMIT=${MUSARE_DEBUG_GIT_LATEST_COMMIT:-true}
  62. - MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT=${MUSARE_DEBUG_GIT_LATEST_COMMIT_SHORT:-true}
  63. links:
  64. - backend
  65. mongo:
  66. image: docker.io/mongo:${MONGO_VERSION}
  67. restart: ${RESTART_POLICY:-unless-stopped}
  68. environment:
  69. - MONGO_INITDB_ROOT_USERNAME=admin
  70. - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  71. - MONGO_INITDB_DATABASE=musare
  72. - MONGO_PORT=${MONGO_PORT:-27017}
  73. - MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  74. - MONGO_USER_USERNAME=${MONGO_USER_USERNAME}
  75. - MONGO_USER_PASSWORD=${MONGO_USER_PASSWORD}
  76. volumes:
  77. - ./tools/docker/setup-mongo.sh:/docker-entrypoint-initdb.d/setup-mongo.sh
  78. - ${MONGO_DATA_LOCATION:-./db}:/data/db
  79. redis:
  80. image: docker.io/redis:7
  81. restart: ${RESTART_POLICY:-unless-stopped}
  82. command: "--notify-keyspace-events Ex --requirepass ${REDIS_PASSWORD} --appendonly yes"
  83. volumes:
  84. - /data