pixelfed/compose.yml

153 lines
3.8 KiB
YAML

---
version: "3.8"
services:
app:
image: zknt/pixelfed
environment:
- DOMAIN
- APP_NAME
- APP_TIMEZONE
- ADMIN_DOMAIN
- OPEN_REGISTRATION
- OAUTH_ENABLED
- ENABLE_ACTIVITYPUB
- DB_CONNECTION=mysql
- DB_DATABASE=pixelfed_prod
- DB_HOST=db
- DB_PASSWORD_FILE=/run/secrets/db_pass
- DB_PORT=3306
- DB_USERNAME=pixelfed
configs:
- source: entrypoint
target: /abra-entrypoint.sh
mode: 0555
- source: envdocker
target: /envfile
mode: 0555
uid: "33"
guid: "33"
entrypoint: /abra-entrypoint.sh
volumes:
- www:/var/www:rw
- app-storage:/var/www/storage
- app-bootstrap:/var/www/bootstrap
networks:
- proxy
- internal
secrets:
- db_password
depends_on:
- db
- redis
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- "coop-cloud.${STACK_NAME}.web.version=1.20.0-ea4560b8"
worker:
image: zknt/pixelfed
environment:
- DOMAIN
- APP_NAME
- APP_TIMEZONE
- ADMIN_DOMAIN
- OPEN_REGISTRATION
- OAUTH_ENABLED
- ENABLE_ACTIVITYPUB
- DB_CONNECTION=mysql
- DB_DATABASE=pixelfed_prod
- DB_HOST=db
- DB_PASSWORD_FILE=/run/secrets/db_pass
- DB_PORT=3306
- DB_USERNAME=pixelfed
volumes:
- app-storage:/var/www/storage
- app-bootstrap:/var/www/bootstrap
networks:
- internal
command: gosu www-data php artisan horizon
secrets:
- db_password
depends_on:
- db
- redis
- app
configs:
- source: worker_entrypoint
target: /abra-entrypoint.sh
mode: 0555
entrypoint:
/abra-entrypoint.sh
db:
image: "mariadb:10.7"
environment:
- MYSQL_DATABASE=pixelfed_prod
- MYSQL_USER=pixelfed
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
networks:
- internal
secrets:
- db_root_password
- db_password
command: --default-authentication-plugin=mysql_native_password
volumes:
- "db-data:/var/lib/mysql"
deploy:
labels:
- "coop-cloud.${STACK_NAME}.db.version=10.7-62601155"
redis:
image: redis:6.2
volumes:
- "redis-data:/data"
networks:
- internal
deploy:
labels:
- "coop-cloud.${STACK_NAME}.cache.version=6.2-"
secrets:
db_root_password:
external: true
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
db_password:
external: true
name: ${STACK_NAME}_db_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
volumes:
db-data:
www:
redis-data:
app-storage:
app-bootstrap:
networks:
internal:
proxy:
external: true
configs:
entrypoint:
name: ${STACK_NAME}_entrypoint_${PIXELFED_ENTRYPOINT_VERSION}
file: entrypoint.sh
worker_entrypoint:
name: ${STACK_NAME}_worker_entrypoint_${PIXELFED_WORKER_ENTRYPOINT_VERSION}
file: worker-entrypoint.sh
envdocker:
name: ${STACK_NAME}_env_docker
file: env.docker.tmpl
template_driver: golang