docker-compose.yaml.default 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. version: '3'
  2. services:
  3. nginx:
  4. image: nginx:alpine
  5. depends_on:
  6. - php
  7. restart: always
  8. tty: false
  9. ports:
  10. - "80:80"
  11. - "443:443"
  12. volumes:
  13. # Nginx
  14. - ./docker/nginx/nginx.conf:/var/nginx/social.conf
  15. - ./docker/nginx/domain.sh:/var/nginx/domain.sh
  16. # Certbot
  17. - ./docker/certbot/www:/var/www/certbot
  18. - ./docker/certbot/.files:/etc/letsencrypt
  19. # Social
  20. - ./public:/var/www/social/public
  21. env_file:
  22. - ./docker/bootstrap/bootstrap.env
  23. - ./docker/db/db.env
  24. command: /bin/sh -c '/var/nginx/domain.sh;
  25. while :; do
  26. sleep 6h & wait $${!};
  27. nginx -s reload;
  28. done &
  29. nginx -g "daemon off;"'
  30. certbot:
  31. image: certbot/certbot
  32. # Check for certificate renewal every 12h as
  33. # recommended by Let's Encrypt
  34. entrypoint: /bin/sh -c 'trap exit TERM;
  35. while :; do
  36. certbot renew > /dev/null;
  37. sleep 12h & wait $${!};
  38. done'
  39. volumes:
  40. - ./docker/certbot/www:/var/www/certbot
  41. - ./docker/certbot/.files:/etc/letsencrypt
  42. php:
  43. build: docker/php
  44. restart: always
  45. tty: true
  46. ports:
  47. - 9000:9000
  48. volumes:
  49. # Entrypoint
  50. - ./docker/php/entrypoint.sh:/entrypoint.sh
  51. - ./docker/db/wait_for_db.sh:/wait_for_db.sh
  52. - ./docker/social/install.sh:/var/entrypoint.d/social_install.sh
  53. # Main files
  54. - .:/var/www/social
  55. env_file:
  56. - ./docker/social/social.env
  57. - ./docker/db/db.env
  58. command: /entrypoint.sh
  59. db:
  60. image: postgres:alpine
  61. restart: always
  62. tty: false
  63. ports:
  64. - 3306:3306
  65. env_file:
  66. - ./docker/db/db.env
  67. redis:
  68. image: redis:alpine
  69. restart: always
  70. tty: false
  71. ports:
  72. - 6379:6379
  73. mail:
  74. build: docker/mail
  75. env_file:
  76. - ./docker/mail/mail.env
  77. ports:
  78. - 25:25
  79. - 110:110
  80. - 143:143
  81. - 587:587
  82. - 993:993
  83. volumes:
  84. - ./docker/mail/mail:/var/mail
  85. - ./docker/mail/config:/etc/mail
  86. # Certbot
  87. - ./docker/certbot/www:/var/www/certbot
  88. - ./docker/certbot/.files:/etc/letsencrypt
  89. volumes:
  90. database: