docker-compose.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. version: "3.8"
  2. services:
  3. backend:
  4. build:
  5. context: ./backend
  6. target: musare_backend
  7. restart: ${RESTART_POLICY:-unless-stopped}
  8. volumes:
  9. - ./.git:/opt/app/.parent_git:ro
  10. - ./backend/config:/opt/app/config
  11. - ./types:/opt/types
  12. environment:
  13. - CONTAINER_MODE=${CONTAINER_MODE:-production}
  14. - MUSARE_SITENAME=${MUSARE_SITENAME:-Musare}
  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. links:
  22. - mongo
  23. - redis
  24. stdin_open: true
  25. tty: true
  26. frontend:
  27. build:
  28. context: ./frontend
  29. target: musare_frontend
  30. args:
  31. FRONTEND_MODE: "${FRONTEND_MODE:-production}"
  32. restart: ${RESTART_POLICY:-unless-stopped}
  33. user: root
  34. ports:
  35. - "${FRONTEND_HOST:-0.0.0.0}:${FRONTEND_PORT:-80}:80"
  36. volumes:
  37. - ./.git:/opt/app/.parent_git:ro
  38. - ./types:/opt/types
  39. environment:
  40. - CONTAINER_MODE=${CONTAINER_MODE:-production}
  41. - FRONTEND_MODE=${FRONTEND_MODE:-production}
  42. - FRONTEND_PORT=${FRONTEND_PORT:-80}
  43. - FRONTEND_CLIENT_PORT=${FRONTEND_CLIENT_PORT:-80}
  44. - FRONTEND_DEV_PORT=${FRONTEND_DEV_PORT:-81}
  45. - FRONTEND_PROD_DEVTOOLS=${FRONTEND_PROD_DEVTOOLS:-false}
  46. - MUSARE_SITENAME=${MUSARE_SITENAME:-Musare}
  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. links:
  54. - backend
  55. mongo:
  56. image: docker.io/mongo:${MONGO_VERSION}
  57. restart: ${RESTART_POLICY:-unless-stopped}
  58. environment:
  59. - MONGO_INITDB_ROOT_USERNAME=admin
  60. - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  61. - MONGO_INITDB_DATABASE=musare
  62. - MONGO_PORT=${MONGO_PORT:-27017}
  63. - MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  64. - MONGO_USER_USERNAME=${MONGO_USER_USERNAME}
  65. - MONGO_USER_PASSWORD=${MONGO_USER_PASSWORD}
  66. volumes:
  67. - ./tools/docker/setup-mongo.sh:/docker-entrypoint-initdb.d/setup-mongo.sh
  68. - ${MONGO_DATA_LOCATION:-./db}:/data/db
  69. redis:
  70. image: docker.io/redis:7
  71. restart: ${RESTART_POLICY:-unless-stopped}
  72. command: "--notify-keyspace-events Ex --requirepass ${REDIS_PASSWORD} --appendonly yes"
  73. volumes:
  74. - /data