docker-compose.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. image: pixelfed/pixelfed:latest
  16. restart: unless-stopped
  17. env_file:
  18. - .env.docker
  19. volumes:
  20. - app-storage:/var/www/storage
  21. - app-bootstrap:/var/www/bootstrap
  22. - "./.env.docker:/var/www/.env"
  23. networks:
  24. - external
  25. - internal
  26. ports:
  27. - "8080:80"
  28. depends_on:
  29. - db
  30. - redis
  31. worker:
  32. image: pixelfed/pixelfed:latest
  33. restart: unless-stopped
  34. env_file:
  35. - .env.docker
  36. volumes:
  37. - app-storage:/var/www/storage
  38. - app-bootstrap:/var/www/bootstrap
  39. networks:
  40. - external
  41. - internal
  42. command: gosu www-data php artisan horizon
  43. depends_on:
  44. - db
  45. - redis
  46. ## DB and Cache
  47. db:
  48. image: mariadb:jammy
  49. restart: unless-stopped
  50. networks:
  51. - internal
  52. command: --default-authentication-plugin=mysql_native_password
  53. env_file:
  54. - .env.docker
  55. volumes:
  56. - "db-data:/var/lib/mysql"
  57. redis:
  58. image: redis:5-alpine
  59. restart: unless-stopped
  60. env_file:
  61. - .env.docker
  62. volumes:
  63. - "redis-data:/data"
  64. networks:
  65. - internal
  66. volumes:
  67. db-data:
  68. redis-data:
  69. app-storage:
  70. app-bootstrap:
  71. networks:
  72. internal:
  73. internal: true
  74. external:
  75. driver: bridge