docker-compose.yml 1.8 KB

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