pixelfed/docker-compose.yml
2019-04-24 22:08:45 +08:00

81 lines
1.9 KiB
YAML

---
version: '3'
# In order to set configuration, please use a .env file in
# your compose project directory (the same directory as your
# docker-compose.yml), and set database options, application
# name, key, and other settings there.
# A list of available settings is available in .env.example
#
# The services should scale properly across a swarm cluster
# if the volumes are properly shared between cluster members.
services:
app:
# Comment to use dockerhub image
build: .
image: pixelfed
## If you have a traefik running, uncomment this to expose Pixelfed
# labels:
# - traefik.enable=true
# - traefik.frontend.rule=Host:your.url
# - traefik.port=80
## If you have a standard reverse proxy, uncommit this to expose Pixelfed
# ports:
# - "127.0.0.1:8080:80"
env_file:
- ./.env
volumes:
- "app-storage:/var/www/storage"
- "app-bootstrap:/var/www/bootstrap"
networks:
- external
- internal
worker:
# Comment to use dockerhub image
build: .
image: pixelfed
env_file:
- ./.env
volumes:
- "app-storage:/var/www/storage"
- "app-bootstrap:/var/www/bootstrap"
networks:
- external # Required for ActivityPub
- internal
command: gosu www-data php artisan horizon
db:
image: mysql:5.7
networks:
- internal
environment:
- MYSQL_DATABASE=pixelfed
- MYSQL_USER=${DB_USERNAME}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_RANDOM_ROOT_PASSWORD=true
volumes:
- "db-data:/var/lib/mysql"
redis:
image: redis:5-alpine
volumes:
- "redis-data:/data"
networks:
- internal
# Adjust your volume data in order to store data where you wish
volumes:
redis-data:
db-data:
app-storage:
app-bootstrap:
networks:
internal:
internal: true
external:
driver: bridge