docker-compose.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. - "./.env:/var/www/.env"
  34. networks:
  35. - external
  36. - internal
  37. worker: # Comment this whole block if HORIZON_EMBED is true.
  38. # Comment to use dockerhub image
  39. build:
  40. context: .
  41. dockerfile: contrib/docker/Dockerfile.apache
  42. #dockerfile: contrib/docker/Dockerfile.fpm
  43. image: pixelfed
  44. restart: unless-stopped
  45. env_file:
  46. - ./.env
  47. volumes:
  48. - "app-storage:/var/www/storage"
  49. - "app-bootstrap:/var/www/bootstrap"
  50. networks:
  51. - external # Required for ActivityPub
  52. - internal
  53. command: gosu www-data php artisan horizon
  54. db:
  55. image: mysql:8.0
  56. restart: unless-stopped
  57. networks:
  58. - internal
  59. command: --default-authentication-plugin=mysql_native_password
  60. environment:
  61. - MYSQL_DATABASE=pixelfed
  62. - MYSQL_USER=${DB_USERNAME}
  63. - MYSQL_PASSWORD=${DB_PASSWORD}
  64. - MYSQL_RANDOM_ROOT_PASSWORD=true
  65. volumes:
  66. - "db-data:/var/lib/mysql"
  67. redis:
  68. image: redis:5-alpine
  69. restart: unless-stopped
  70. volumes:
  71. - "redis-data:/data"
  72. networks:
  73. - internal
  74. # Adjust your volume data in order to store data where you wish
  75. volumes:
  76. redis-data:
  77. db-data:
  78. app-storage:
  79. app-bootstrap:
  80. networks:
  81. internal:
  82. internal: true
  83. external:
  84. driver: bridge