docker-compose.yml 3.4 KB

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