1
0
Fork 0
pixelfed/docker-compose.yml

126 lines
4.0 KiB
YAML
Raw Normal View History

2018-05-20 13:02:29 +00:00
---
2024-01-06 14:19:36 +00:00
version: "3"
2024-01-06 14:19:36 +00:00
###############################################################
# Please see docker/README.md for usage information
###############################################################
2018-05-20 13:02:29 +00:00
services:
2024-01-06 16:43:48 +00:00
# HTTP/HTTPS proxy
#
2024-01-15 15:14:44 +00:00
# Sits in front of the *real* webserver and manages SSL and (optionally)
# load-balancing between multiple web servers
#
2024-01-06 16:43:48 +00:00
# See: https://github.com/nginx-proxy/nginx-proxy/tree/main/docs
proxy:
image: nginxproxy/nginx-proxy:1.4
2024-01-06 18:01:48 +00:00
container_name: "${DOCKER_CONTAINER_NAME_PREFIX}-proxy"
2024-01-15 14:42:54 +00:00
restart: unless-stopped
2024-01-15 19:20:22 +00:00
profiles:
- ${DOCKER_PROXY_PROFILE}
2024-01-06 16:43:48 +00:00
volumes:
2024-01-06 18:01:48 +00:00
- "${DOCKER_HOST_SOCKET_PATH}:/tmp/docker.sock:ro"
2024-01-06 16:43:48 +00:00
- "${DOCKER_CONFIG_ROOT}/proxy/conf.d:/etc/nginx/conf.d"
- "${DOCKER_CONFIG_ROOT}/proxy/vhost.d:/etc/nginx/vhost.d"
2024-01-06 18:01:48 +00:00
- "${DOCKER_CONFIG_ROOT}/proxy/certs:/etc/nginx/certs"
- "${DOCKER_DATA_ROOT}/proxy/html:/usr/share/nginx/html"
2024-01-06 16:43:48 +00:00
ports:
- "${DOCKER_PROXY_PORT_EXTERNAL_HTTP}:80"
- "${DOCKER_PROXY_PORT_EXTERNAL_HTTPS}:443"
# Proxy companion for managing letsencrypt SSL certificates
#
# See: https://github.com/nginx-proxy/acme-companion/tree/main/docs
proxy-acme:
image: nginxproxy/acme-companion
2024-01-06 18:01:48 +00:00
container_name: "${DOCKER_CONTAINER_NAME_PREFIX}-proxy-acme"
2024-01-15 14:42:54 +00:00
restart: unless-stopped
2024-01-15 19:20:22 +00:00
profiles:
2024-01-15 19:39:59 +00:00
- ${DOCKER_PROXY_ACME_PROFILE}
2024-01-06 16:43:48 +00:00
environment:
2024-01-06 18:01:48 +00:00
DEBUG: 0
2024-01-06 16:43:48 +00:00
DEFAULT_EMAIL: "${LETSENCRYPT_EMAIL}"
2024-01-06 18:01:48 +00:00
NGINX_PROXY_CONTAINER: "${DOCKER_CONTAINER_NAME_PREFIX}-proxy"
2024-01-06 16:43:48 +00:00
depends_on:
- proxy
volumes:
2024-01-06 18:01:48 +00:00
- "${DOCKER_HOST_SOCKET_PATH}:/var/run/docker.sock:ro"
2024-01-06 16:43:48 +00:00
- "${DOCKER_CONFIG_ROOT}/proxy/conf.d:/etc/nginx/conf.d"
- "${DOCKER_CONFIG_ROOT}/proxy/vhost.d:/etc/nginx/vhost.d"
2024-01-06 18:01:48 +00:00
- "${DOCKER_CONFIG_ROOT}/proxy/certs:/etc/nginx/certs"
- "${DOCKER_DATA_ROOT}/proxy/html:/usr/share/nginx/html"
- "${DOCKER_DATA_ROOT}/proxy-acme:/etc/acme.sh"
2024-01-06 16:43:48 +00:00
2024-01-06 14:19:36 +00:00
web:
image: "${DOCKER_IMAGE}:${DOCKER_TAG}"
2024-01-06 18:01:48 +00:00
container_name: "${DOCKER_CONTAINER_NAME_PREFIX}-web"
2019-06-03 02:53:13 +00:00
restart: unless-stopped
2024-01-06 18:01:48 +00:00
build:
target: apache-runtime
2018-05-20 13:02:29 +00:00
volumes:
2024-01-06 14:19:36 +00:00
- "./.env:/var/www/.env"
- "${DOCKER_DATA_ROOT}/pixelfed/cache:/var/www/bootstrap/cache"
- "${DOCKER_DATA_ROOT}/pixelfed/storage:/var/www/storage"
2024-01-06 16:43:48 +00:00
environment:
2024-01-06 18:01:48 +00:00
LETSENCRYPT_HOST: "${LETSENCRYPT_HOST}"
LETSENCRYPT_EMAIL: "${LETSENCRYPT_EMAIL}"
LETSENCRYPT_TEST: "${LETSENCRYPT_TEST}"
VIRTUAL_HOST: "${APP_DOMAIN}"
2024-01-06 16:43:48 +00:00
VIRTUAL_PORT: "80"
labels:
com.github.nginx-proxy.nginx-proxy.keepalive: 30
com.github.nginx-proxy.nginx-proxy.http2.enable: true
com.github.nginx-proxy.nginx-proxy.http3.enable: true
2024-01-15 19:39:59 +00:00
ports:
- "${DOCKER_WEB_PORT_EXTERNAL_HTTP}:80"
2020-04-11 15:48:02 +00:00
depends_on:
2020-04-11 15:52:05 +00:00
- db
2020-04-11 15:48:02 +00:00
- redis
2020-04-11 15:48:02 +00:00
worker:
2024-01-06 14:19:36 +00:00
image: "${DOCKER_IMAGE}:${DOCKER_TAG}"
2024-01-06 18:01:48 +00:00
container_name: "${DOCKER_CONTAINER_NAME_PREFIX}-worker"
2024-01-06 14:19:36 +00:00
command: gosu www-data php artisan horizon
2019-06-03 02:53:13 +00:00
restart: unless-stopped
2024-01-06 18:01:48 +00:00
deploy:
mode: replicated
replicas: 1
build:
target: apache-runtime
2019-04-22 02:40:32 +00:00
volumes:
2024-01-06 14:19:36 +00:00
- "./.env:/var/www/.env"
- "${DOCKER_DATA_ROOT}/pixelfed/cache:/var/www/bootstrap/cache"
- "${DOCKER_DATA_ROOT}/pixelfed/storage:/var/www/storage"
2020-04-11 15:48:02 +00:00
depends_on:
2020-04-11 15:52:05 +00:00
- db
2020-04-11 15:48:02 +00:00
- redis
db:
2024-01-06 14:19:36 +00:00
image: mariadb:11.2
2024-01-06 18:01:48 +00:00
container_name: "${DOCKER_CONTAINER_NAME_PREFIX}-db"
command: --default-authentication-plugin=mysql_native_password
2024-01-06 14:19:36 +00:00
restart: unless-stopped
2024-01-06 18:01:48 +00:00
env_file:
- ".env"
2018-05-20 13:02:29 +00:00
volumes:
2024-01-06 14:19:36 +00:00
- "${DOCKER_DATA_ROOT}/db:/var/lib/mysql"
ports:
- "${DOCKER_DB_PORT_EXTERNAL}:3306"
2018-05-20 13:02:29 +00:00
redis:
2024-01-06 14:19:36 +00:00
image: redis:7
2024-01-06 18:01:48 +00:00
container_name: "${DOCKER_CONTAINER_NAME_PREFIX}-redis"
2019-06-03 02:53:13 +00:00
restart: unless-stopped
2024-01-06 18:01:48 +00:00
env_file:
- ".env"
2018-05-20 13:02:29 +00:00
volumes:
2024-01-06 14:19:36 +00:00
- "${DOCKER_CONFIG_ROOT}/redis:/etc/redis"
- "${DOCKER_DATA_ROOT}/redis:/data"
ports:
- "${DOCKER_REDIS_PORT_EXTERNAL}:6399"
healthcheck:
interval: 10s
timeout: 5s
retries: 2
test: ["CMD", "redis-cli", "-p", "6399", "ping"]