docker-compose.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. - /opt/app/node_modules
  11. - ./backend/config:/opt/app/config
  12. links:
  13. - mongo
  14. - redis
  15. stdin_open: true
  16. tty: true
  17. frontend:
  18. build:
  19. context: ./frontend
  20. target: musare_frontend
  21. args:
  22. FRONTEND_MODE: "${FRONTEND_MODE:-prod}"
  23. restart: ${RESTART_POLICY:-unless-stopped}
  24. user: root
  25. ports:
  26. - "${FRONTEND_HOST:-0.0.0.0}:${FRONTEND_PORT:-80}:80"
  27. volumes:
  28. - ./.git:/opt/app/.parent_git:ro
  29. - ./frontend/dist/config:/opt/app/dist/config
  30. environment:
  31. - FRONTEND_MODE=${FRONTEND_MODE:-prod}
  32. - CONTAINER_MODE=${CONTAINER_MODE:-prod}
  33. links:
  34. - backend
  35. mongo:
  36. image: docker.io/mongo:${MONGO_VERSION}
  37. restart: ${RESTART_POLICY:-unless-stopped}
  38. environment:
  39. - MONGO_INITDB_ROOT_USERNAME=admin
  40. - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  41. - MONGO_INITDB_DATABASE=musare
  42. - MONGO_PORT=${MONGO_PORT:-27017}
  43. - MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  44. - MONGO_USER_USERNAME=${MONGO_USER_USERNAME}
  45. - MONGO_USER_PASSWORD=${MONGO_USER_PASSWORD}
  46. volumes:
  47. - ./tools/docker/setup-mongo.sh:/docker-entrypoint-initdb.d/setup-mongo.sh
  48. - ${MONGO_DATA_LOCATION:-./db}:/data/db
  49. redis:
  50. image: docker.io/redis:6.2
  51. restart: ${RESTART_POLICY:-unless-stopped}
  52. command: "--notify-keyspace-events Ex --requirepass ${REDIS_PASSWORD} --appendonly yes"
  53. volumes:
  54. - /data