docker-compose.fragment.sh 888 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/sh
  2. if [ "${BUILD_PHP}" -ne 0 ]; then
  3. cat <<EOF
  4. php:
  5. build: docker/php
  6. EOF
  7. else
  8. cat <<EOF
  9. php:
  10. image: gsocial/php
  11. EOF
  12. fi
  13. # If the user wants a DB docker container
  14. if echo "${DOCKER}" | grep -Fvq '"db"'; then
  15. cat <<EOF
  16. depends_on:
  17. - db
  18. EOF
  19. fi
  20. cat <<EOF
  21. restart: always
  22. tty: true
  23. ports:
  24. - ${PHP_PORT}:9000
  25. volumes:
  26. # Entrypoint
  27. - ./docker/php/entrypoint.sh:/entrypoint.sh
  28. - ./docker/db/wait_for_db.sh:/wait_for_db.sh
  29. - ./docker/social/install.sh:/var/entrypoint.d/social_install.sh
  30. # Main files
  31. - .:/var/www/social
  32. - /var/www/social/docker # exclude docker folder
  33. env_file:
  34. - ./docker/social/social.env
  35. - ./docker/db/db.env
  36. command: /entrypoint.sh
  37. EOF