docker-compose.fragment.sh 923 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/sh
  2. if [ "${BUILD_PHP}" -ne 0 ]; then
  3. cat <<EOF
  4. worker:
  5. build: docker/php
  6. EOF
  7. else
  8. cat <<EOF
  9. worker:
  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. volumes:
  24. # Entrypoint
  25. - ./docker/php/entrypoint.sh:/entrypoint.sh
  26. - ./docker/db/wait_for_db.sh:/wait_for_db.sh
  27. - ./docker/social/install.sh:/var/entrypoint.d/social_install.sh
  28. - ./docker/worker/worker.sh:/var/entrypoint.d/social_worker.sh
  29. # Main files
  30. - .:/var/www/social
  31. - /var/www/social/docker # exclude docker folder
  32. env_file:
  33. - ./docker/social/social.env
  34. - ./docker/db/db.env
  35. command: /entrypoint.sh
  36. EOF