docker-compose.yaml.default 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. - /var/www/social/docker
  56. env_file:
  57. - ./docker/social/social.env
  58. - ./docker/db/db.env
  59. command: /entrypoint.sh
  60. db:
  61. image: postgres:alpine
  62. restart: always
  63. tty: false
  64. ports:
  65. - 3306:3306
  66. env_file:
  67. - ./docker/db/db.env
  68. redis:
  69. image: redis:alpine
  70. restart: always
  71. tty: false
  72. ports:
  73. - 6379:6379
  74. mail:
  75. build: docker/mail
  76. env_file:
  77. - ./docker/mail/mail.env
  78. ports:
  79. - 25:25
  80. - 110:110
  81. - 143:143
  82. - 587:587
  83. - 993:993
  84. volumes:
  85. - ./docker/mail/mail:/var/mail
  86. - ./docker/mail/config:/etc/mail
  87. # Certbot
  88. - ./docker/certbot/www:/var/www/certbot
  89. - ./docker/certbot/.files:/etc/letsencrypt
  90. volumes:
  91. database: