docker-compose.yml 1.6 KB

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