docker-compose.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ---
  2. version: '3'
  3. # In order to set configuration, please use a .env file in
  4. # your compose project directory (the same directory as your
  5. # docker-compose.yml), and set database options, application
  6. # name, key, and other settings there.
  7. # A list of available settings is available in .env.example
  8. #
  9. # The services should scale properly across a swarm cluster
  10. # if the volumes are properly shared between cluster members.
  11. services:
  12. ## App and Worker
  13. app:
  14. # Comment to use dockerhub image
  15. build:
  16. context: .
  17. dockerfile: contrib/docker/Dockerfile.apache
  18. image: pixelfed
  19. restart: unless-stopped
  20. env_file:
  21. - .env.docker
  22. volumes:
  23. - app-storage:/var/www/storage
  24. - app-bootstrap:/var/www/bootstrap
  25. networks:
  26. - external
  27. - internal
  28. ports:
  29. - "8080:80"
  30. depends_on:
  31. - db
  32. - redis
  33. worker:
  34. build:
  35. context: .
  36. dockerfile: contrib/docker/Dockerfile.apache
  37. image: pixelfed
  38. restart: unless-stopped
  39. env_file:
  40. - .env.docker
  41. volumes:
  42. - app-storage:/var/www/storage
  43. - app-bootstrap:/var/www/bootstrap
  44. networks:
  45. - external
  46. - internal
  47. command: gosu www-data php artisan horizon
  48. depends_on:
  49. - db
  50. - redis
  51. ## DB and Cache
  52. db:
  53. image: mysql:8.0
  54. restart: unless-stopped
  55. networks:
  56. - internal
  57. command: --default-authentication-plugin=mysql_native_password
  58. env_file:
  59. - .env.docker
  60. volumes:
  61. - "db-data:/var/lib/mysql"
  62. redis:
  63. image: redis:5-alpine
  64. restart: unless-stopped
  65. env_file:
  66. - .env.docker
  67. volumes:
  68. - "redis-data:/data"
  69. networks:
  70. - internal
  71. volumes:
  72. db-data:
  73. redis-data:
  74. app-storage:
  75. app-bootstrap:
  76. networks:
  77. internal:
  78. internal: true
  79. external:
  80. driver: bridge