docker-compose.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. version: '3'
  2. services:
  3. backend:
  4. build: ./backend
  5. ports:
  6. - "${BACKEND_HOST}:${BACKEND_PORT}:8080"
  7. volumes:
  8. - ./backend:/opt/app
  9. - ./log:/opt/log
  10. links:
  11. - mongo
  12. - redis
  13. stdin_open: true
  14. tty: true
  15. frontend:
  16. build: ./frontend
  17. ports:
  18. - "${FRONTEND_HOST}:${FRONTEND_PORT}:80"
  19. volumes:
  20. - ./frontend:/opt/app
  21. - /opt/app/node_modules/
  22. environment:
  23. - FRONTEND_MODE=${FRONTEND_MODE}
  24. mongo:
  25. image: mongo:4.0
  26. ports:
  27. - "${MONGO_HOST}:${MONGO_PORT}:${MONGO_PORT}"
  28. environment:
  29. - MONGO_INITDB_ROOT_USERNAME=admin
  30. - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  31. - MONGO_INITDB_DATABASE=musare
  32. - MONGO_PORT=${MONGO_PORT}
  33. - MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  34. - MONGO_USER_USERNAME=${MONGO_USER_USERNAME}
  35. - MONGO_USER_PASSWORD=${MONGO_USER_PASSWORD}
  36. volumes:
  37. - ./tools/docker/setup-mongo.sh:/docker-entrypoint-initdb.d/setup-mongo.sh
  38. - ./.db:/data/db
  39. redis:
  40. image: redis
  41. ports:
  42. - "${REDIS_HOST}:${REDIS_PORT}:6379"
  43. command: "--notify-keyspace-events Ex --requirepass ${REDIS_PASSWORD} --appendonly yes"
  44. volumes:
  45. - .redis:/data