docker-compose.yaml.default 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. image: gsocial/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 # exclude docker folder
  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. - 5432:5432
  66. environment:
  67. - PGDATA=/var/lib/postgres/data
  68. env_file:
  69. - ./docker/db/db.env
  70. volumes:
  71. - database:/var/lib/postgres/data
  72. redis:
  73. image: redis:alpine
  74. restart: always
  75. tty: false
  76. volumes:
  77. - ./docker/redis/redis.conf:/etc/redis/redis.conf
  78. ports:
  79. - 6379:6379
  80. command: redis-server /etc/redis/redis.conf
  81. worker:
  82. image: gsocial/php
  83. restart: always
  84. tty: true
  85. volumes:
  86. # Entrypoint
  87. - ./docker/php/entrypoint.sh:/entrypoint.sh
  88. - ./docker/db/wait_for_db.sh:/wait_for_db.sh
  89. - ./docker/social/install.sh:/var/entrypoint.d/social_install.sh
  90. - ./docker/worker/worker.sh:/var/entrypoint.d/social_worker.sh
  91. # Main files
  92. - .:/var/www/social
  93. - /var/www/social/docker # exclude docker folder
  94. env_file:
  95. - ./docker/social/social.env
  96. - ./docker/db/db.env
  97. command: /entrypoint.sh
  98. volumes:
  99. database: