docker-compose.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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:
  13. # Comment to use dockerhub image
  14. build:
  15. context: .
  16. dockerfile: contrib/docker/Dockerfile.apache
  17. #dockerfile: contrib/docker/Dockerfile.fpm
  18. image: pixelfed
  19. restart: unless-stopped
  20. ## If you have a traefik running, uncomment this to expose Pixelfed
  21. # labels:
  22. # - traefik.enable=true
  23. # - traefik.frontend.rule=Host:your.url
  24. # - traefik.port=80
  25. ## If you have a standard reverse proxy, uncommit this to expose Pixelfed
  26. # ports:
  27. # - "127.0.0.1:8080:80"
  28. env_file:
  29. - ./.env
  30. volumes:
  31. - "app-storage:/var/www/storage"
  32. - "app-bootstrap:/var/www/bootstrap"
  33. networks:
  34. - external
  35. - internal
  36. worker: # Comment this whole block if HORIZON_EMBED is true.
  37. # Comment to use dockerhub image
  38. build:
  39. context: .
  40. dockerfile: contrib/docker/Dockerfile.apache
  41. #dockerfile: contrib/docker/Dockerfile.fpm
  42. image: pixelfed
  43. restart: unless-stopped
  44. env_file:
  45. - ./.env
  46. volumes:
  47. - "app-storage:/var/www/storage"
  48. - "app-bootstrap:/var/www/bootstrap"
  49. networks:
  50. - external # Required for ActivityPub
  51. - internal
  52. command: gosu www-data php artisan horizon
  53. db:
  54. image: mysql:8.0
  55. restart: unless-stopped
  56. networks:
  57. - internal
  58. command: --default-authentication-plugin=mysql_native_password
  59. environment:
  60. - MYSQL_DATABASE=pixelfed
  61. - MYSQL_USER=${DB_USERNAME}
  62. - MYSQL_PASSWORD=${DB_PASSWORD}
  63. - MYSQL_RANDOM_ROOT_PASSWORD=true
  64. volumes:
  65. - "db-data:/var/lib/mysql"
  66. redis:
  67. image: redis:5-alpine
  68. restart: unless-stopped
  69. volumes:
  70. - "redis-data:/data"
  71. networks:
  72. - internal
  73. # Adjust your volume data in order to store data where you wish
  74. volumes:
  75. redis-data:
  76. db-data:
  77. app-storage:
  78. app-bootstrap:
  79. networks:
  80. internal:
  81. internal: true
  82. external:
  83. driver: bridge