docker-compose.yml 856 B

1234567891011121314151617181920212223242526272829303132
  1. version: '2'
  2. services:
  3. backend:
  4. build: ./backend
  5. ports:
  6. - "${BACKEND_PORT}:8080"
  7. volumes:
  8. - ./backend:/opt/app
  9. - ./log:/opt/log
  10. links:
  11. - mongo
  12. frontend:
  13. build: ./frontend
  14. ports:
  15. - "${FRONTEND_PORT}:80"
  16. volumes:
  17. - ./frontend:/opt/app
  18. mongo:
  19. image: mongo:4.0
  20. ports:
  21. - "${MONGO_PORT}:27017"
  22. environment:
  23. - MONGO_INITDB_ROOT_USERNAME=${MONGO_ROOT_USERNAME}
  24. - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  25. - MONGO_PORT=${MONGO_PORT}
  26. - MONGO_DATABASE=${MONGO_DATABASE}
  27. - MONGO_ROOT_USERNAME=${MONGO_ROOT_USERNAME}
  28. - MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
  29. - MONGO_USER_USERNAME=${MONGO_USER_USERNAME}
  30. - MONGO_USER_PASSWORD=${MONGO_USER_PASSWORD}
  31. volumes:
  32. - ./setup-mongo-docker.sh:/docker-entrypoint-initdb.d/setup-mongo.sh