Files
Crussell/compose.yml
T
popertots 91fe5ea399 Fix compose backend env file; document R2 and Square webhook variables
compose.yml backend service now reads the root ./.env (which README instructs users to create) instead of the nonexistent backend/.env. Promote R2_ACCESS_KEY/R2_SECRET_KEY/R2_BUCKET/R2_PUBLIC_URL to active vars (prod S3 reads all four via getEnv) and document the webhook URL/signature-key exact-match requirement with fail-closed (503/403) wording.
2026-08-22 00:34:49 +01:00

101 lines
2.6 KiB
YAML

services:
postgres:
image: postgres:17
container_name: postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432" # locally, do not push to prod
volumes:
- pgdata:/var/lib/postgresql/data
- ./init-scripts/init-script.sql:/docker-entrypoint-initdb.d/init-script.sql:ro
networks:
- appnet
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: backend
restart: always
env_file:
- ./.env # created via `cp .env.example .env` (see README Getting Started)
volumes:
- ./backend/bin:/app/bin # Mount your compiled binary
depends_on:
- postgres
networks:
- appnet
sabredav:
image: php:8.2-fpm
container_name: sabredav
restart: always
working_dir: /var/www/dav
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
DAV_ADMIN_PASSWORD: ${DAV_ADMIN_PASSWORD:-admin} # Must be set in production
volumes:
- ./sabredav:/var/www/dav
depends_on:
- postgres
networks:
- appnet
command: >
bash -c " apt-get update && apt-get install -y git unzip libzip-dev libpq-dev && docker-php-ext-install pdo pdo_pgsql zip && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && if [ ! -f /var/www/dav/vendor/autoload.php ]; then
cd /var/www/dav && composer install --no-dev --optimize-autoloader;
fi && php-fpm "
nginx:
image: nginx:stable
container_name: nginx
restart: always
ports:
- "80:80"
- "443:443"
- "9000:9000" # Rustfs S3 API
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/certs:/etc/nginx/certs
- ./frontend/build:/usr/share/nginx/html # Serve frontend
- ./sabredav:/var/www/dav
- rustfs_data:/data
depends_on:
- backend
- sabredav
networks:
- appnet
rustfs:
image: rustfs/rustfs:latest
container_name: rustfs
restart: always
ports:
- "9000:9000"
- "9001:9001"
environment:
- RUSTFS_ADMIN_ACCESS_KEY=rustfsadmin
- RUSTFS_ADMIN_SECRET_KEY=rustfsadmin
- RUSTFS_ACCESS_KEY=rustfsadmin
- RUSTFS_SECRET_KEY=rustfsadmin
- RUSTFS_BUCKET=crussell
volumes:
- rustfs_data:/data
networks:
- appnet
volumes:
pgdata:
rustfs_data:
networks:
appnet: